forked from potsda.mn/mobilizon
call refreshApp() and reload the page on refreshApp event without displaying popup message
This commit is contained in:
parent
6b2d6783bc
commit
44f32494b8
|
@ -129,14 +129,7 @@ export default class App extends Vue {
|
||||||
console.debug("online");
|
console.debug("online");
|
||||||
});
|
});
|
||||||
document.addEventListener("refreshApp", (event: Event) => {
|
document.addEventListener("refreshApp", (event: Event) => {
|
||||||
this.$buefy.snackbar.open({
|
const refreshAppEvent = async () => {
|
||||||
queue: false,
|
|
||||||
indefinite: true,
|
|
||||||
type: "is-secondary",
|
|
||||||
actionText: this.$t("Update app") as string,
|
|
||||||
cancelText: this.$t("Ignore") as string,
|
|
||||||
message: this.$t("A new version is available.") as string,
|
|
||||||
onAction: async () => {
|
|
||||||
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
const detail = event.detail;
|
const detail = event.detail;
|
||||||
|
@ -146,14 +139,10 @@ export default class App extends Vue {
|
||||||
window.location.reload();
|
window.location.reload();
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
console.error(err);
|
console.error(err);
|
||||||
this.$notifier.error(
|
|
||||||
this.$t(
|
|
||||||
"An error has occured while refreshing the page."
|
|
||||||
) as string
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
},
|
};
|
||||||
});
|
|
||||||
|
refreshAppEvent();
|
||||||
});
|
});
|
||||||
|
|
||||||
this.interval = setInterval(async () => {
|
this.interval = setInterval(async () => {
|
||||||
|
|
Loading…
Reference in a new issue