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

12 lines
405 B
JavaScript

import { store } from '../_store/store'
import { importShowComposeDialog } from '../_components/dialog/asyncDialogs'
export async function showShareDialogIfNecessary () {
const { isUserLoggedIn, openShareDialog } = store.get()
store.set({ openShareDialog: false })
if (isUserLoggedIn && openShareDialog) {
const showComposeDialog = await importShowComposeDialog()
showComposeDialog()
}
}