postingInitialState.js 1.23 KB
/**
 * # postingInitialState.js
 *
 *
 */
'use strict';
/**
 * ## Import immutable record
 */
import Immutable, {List, Record} from 'immutable';

/**
 * ## InitialState
 *
 * The fields we're concerned with
 */
let InitialState = Record({
	// isFetching: false,
	// error: null,
	// currentBoardName: '',
	// currentBoardId: '',
	// title: '',
	// content: '',
	boards: new (Record({
		isFetching: false,
		error: null,
		list: List(),
	})),
	// assets: List(),
	// dataValid: false, //是否可以点击发送
	// inPosting: false,//正在上传
	// postFail: false,
	// finishedCount: 0,
	// postPercent: 0,
	// postingBannerShow: false,
	// uploadState: 0,
	userState: new (Record({
		isFetching: false,
		error: null,
		forbidNickname: 'N',
		forbidSpeaking: 'N',
	})),
	canSubmit: false,
	post: new (Record({
		title: '',
		content: '',
		sectionId: 0,
		sectionName: '',
		assets: List(),
	})),
	postState: new (Record({
		isPosting: false,
		error: null,
		showProcess: true,
		status: 0,	// 0 - 未发布,1 - 发布中,2 - 发布成功,3 - 发布失败
		stage: 0,	// 0 - 图片上传,1 - 帖子上传
		uploadedImageCount: 0, // 已上传图片数量
		uploadedImagePercent: 0, // 已上传图片百分比
	})),
});

export default InitialState;