Pinafore-Web-Client-Frontend/src/routes/_actions/showShareDialogIfNecessary.js

12 lines
432 B
JavaScript
Raw Normal View History

import { store } from '../_store/store'
import { importShowComposeDialog } from '../_components/dialog/asyncDialogs/importShowComposeDialog.js'
export async function showShareDialogIfNecessary () {
2019-08-03 22:49:37 +02:00
const { isUserLoggedIn, openShareDialog } = store.get()
store.set({ openShareDialog: false })
if (isUserLoggedIn && openShareDialog) {
2019-08-03 22:49:37 +02:00
const showComposeDialog = await importShowComposeDialog()
showComposeDialog()
}
}