refactor: change progress restore prompt from modal to toast
This commit is contained in:
@@ -311,6 +311,8 @@ pre.ace_editor {
|
|||||||
}
|
}
|
||||||
|
|
||||||
.toasted-container {
|
.toasted-container {
|
||||||
|
@apply max-w-md;
|
||||||
|
|
||||||
.toasted {
|
.toasted {
|
||||||
&.toasted-primary {
|
&.toasted-primary {
|
||||||
@apply bg-tooltip;
|
@apply bg-tooltip;
|
||||||
|
|||||||
@@ -103,12 +103,6 @@
|
|||||||
</SmartTab>
|
</SmartTab>
|
||||||
</SmartTabs>
|
</SmartTabs>
|
||||||
</Pane>
|
</Pane>
|
||||||
<SmartConfirmModal
|
|
||||||
:show="confirmSync"
|
|
||||||
:title="`${$t('confirm.sync')}`"
|
|
||||||
@hide-modal="confirmSync = false"
|
|
||||||
@resolve="syncRequest"
|
|
||||||
/>
|
|
||||||
</Splitpanes>
|
</Splitpanes>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@@ -121,6 +115,7 @@ import {
|
|||||||
Ref,
|
Ref,
|
||||||
ref,
|
ref,
|
||||||
useContext,
|
useContext,
|
||||||
|
watch,
|
||||||
} from "@nuxtjs/composition-api"
|
} from "@nuxtjs/composition-api"
|
||||||
import { Splitpanes, Pane } from "splitpanes"
|
import { Splitpanes, Pane } from "splitpanes"
|
||||||
import "splitpanes/dist/splitpanes.css"
|
import "splitpanes/dist/splitpanes.css"
|
||||||
@@ -147,8 +142,10 @@ import {
|
|||||||
import { translateExtURLParams } from "~/helpers/RESTExtURLParams"
|
import { translateExtURLParams } from "~/helpers/RESTExtURLParams"
|
||||||
import {
|
import {
|
||||||
pluckRef,
|
pluckRef,
|
||||||
|
useI18n,
|
||||||
useReadonlyStream,
|
useReadonlyStream,
|
||||||
useStream,
|
useStream,
|
||||||
|
useToast,
|
||||||
} from "~/helpers/utils/composables"
|
} from "~/helpers/utils/composables"
|
||||||
import { loadRequestFromSync, startRequestSync } from "~/helpers/fb/request"
|
import { loadRequestFromSync, startRequestSync } from "~/helpers/fb/request"
|
||||||
import { onLoggedIn } from "~/helpers/fb/auth"
|
import { onLoggedIn } from "~/helpers/fb/auth"
|
||||||
@@ -235,6 +232,32 @@ export default defineComponent({
|
|||||||
|
|
||||||
const confirmSync = ref(false)
|
const confirmSync = ref(false)
|
||||||
|
|
||||||
|
const toast = useToast()
|
||||||
|
const t = useI18n()
|
||||||
|
|
||||||
|
watch(confirmSync, (newValue) => {
|
||||||
|
if (newValue) {
|
||||||
|
toast.show(`${t("confirm.sync")}`, {
|
||||||
|
duration: 0,
|
||||||
|
action: [
|
||||||
|
{
|
||||||
|
text: `${t("action.yes")}`,
|
||||||
|
onClick: (_, toastObject) => {
|
||||||
|
syncRequest()
|
||||||
|
toastObject.goAway(0)
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
text: `${t("action.no")}`,
|
||||||
|
onClick: (_, toastObject) => {
|
||||||
|
toastObject.goAway(0)
|
||||||
|
},
|
||||||
|
},
|
||||||
|
],
|
||||||
|
})
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
const syncRequest = () => {
|
const syncRequest = () => {
|
||||||
setRESTRequest(
|
setRESTRequest(
|
||||||
safelyExtractRESTRequest(requestForSync.value!, getDefaultRESTRequest())
|
safelyExtractRESTRequest(requestForSync.value!, getDefaultRESTRequest())
|
||||||
|
|||||||
Reference in New Issue
Block a user