mirror of
https://github.com/ecency/ecency-mobile.git
synced 2024-12-23 13:22:02 +03:00
Merge pull request #2112 from ecency/nt/editor-replace
NT - Editor Replace
This commit is contained in:
commit
a4682a4044
@ -28,6 +28,8 @@ const DraftsContainer = ({ currentAccount, intl, navigation, dispatch }) => {
|
||||
const [schedules, setSchedules] = useState([]);
|
||||
const [isLoading, setIsLoading] = useState(false);
|
||||
|
||||
const [initialTabIndex] = useState(navigation.state?.params?.showSchedules ? 1 : 0);
|
||||
|
||||
useEffect(() => {
|
||||
_getDrafts();
|
||||
_getSchedules();
|
||||
@ -145,6 +147,7 @@ const DraftsContainer = ({ currentAccount, intl, navigation, dispatch }) => {
|
||||
removeDraft={_removeDraft}
|
||||
moveScheduleToDraft={_moveScheduleToDraft}
|
||||
removeSchedule={_removeSchedule}
|
||||
initialTabIndex={initialTabIndex}
|
||||
/>
|
||||
);
|
||||
};
|
||||
|
@ -15,7 +15,6 @@ import { BasicHeader, TabBar, DraftListItem, PostCardPlaceHolder } from '../../.
|
||||
import globalStyles from '../../../globalStyles';
|
||||
import styles from './draftStyles';
|
||||
import { OptionsModal } from '../../../components/atoms';
|
||||
import { jsonStringify } from '../../../utils/jsonUtils';
|
||||
|
||||
const DraftsScreen = ({
|
||||
currentAccount,
|
||||
@ -27,6 +26,7 @@ const DraftsScreen = ({
|
||||
drafts,
|
||||
schedules,
|
||||
moveScheduleToDraft,
|
||||
initialTabIndex,
|
||||
}) => {
|
||||
const [selectedId, setSelectedId] = useState(null);
|
||||
const ActionSheetRef = useRef(null);
|
||||
@ -123,6 +123,7 @@ const DraftsScreen = ({
|
||||
|
||||
<ScrollableTabView
|
||||
style={[globalStyles.tabView, { paddingBottom: 40 }]}
|
||||
initialPage={initialTabIndex}
|
||||
renderTabBar={() => (
|
||||
<TabBar
|
||||
style={styles.tabbar}
|
||||
|
@ -717,13 +717,14 @@ class EditorContainer extends Component {
|
||||
this.setState({
|
||||
isPostSending: false,
|
||||
});
|
||||
navigation.navigate({
|
||||
routeName: ROUTES.SCREENS.PROFILE,
|
||||
params: {
|
||||
navigation.replace(
|
||||
ROUTES.SCREENS.PROFILE,
|
||||
{
|
||||
username: get(currentAccount, 'name'),
|
||||
},
|
||||
key: get(currentAccount, 'name'),
|
||||
});
|
||||
},{
|
||||
key:get(currentAccount, 'name')
|
||||
}
|
||||
);
|
||||
}, 3000);
|
||||
})
|
||||
.catch((error) => {
|
||||
@ -1058,10 +1059,10 @@ class EditorContainer extends Component {
|
||||
);
|
||||
|
||||
setTimeout(() => {
|
||||
navigation.navigate({
|
||||
routeName: ROUTES.SCREENS.DRAFTS,
|
||||
key: currentAccount.name,
|
||||
});
|
||||
navigation.replace(ROUTES.SCREENS.DRAFTS,
|
||||
{
|
||||
showSchedules:true
|
||||
})
|
||||
}, 3000);
|
||||
})
|
||||
.catch((error) => {
|
||||
|
Loading…
Reference in New Issue
Block a user