安卓断线重连时刷新页面

This commit is contained in:
fangxiang 2022-09-02 16:58:33 +08:00
parent 5476b2c0cb
commit 6e829b06c6
1 changed files with 8 additions and 0 deletions

View File

@ -37,7 +37,9 @@ export default defineComponent({
const remote_data_exange_processer = new RemoteDataExangeProcesser(options);
remote_data_exange_processer.enable();
let disconnect_flag = false;
EventBus.getInstance().on(EventNamesDefine.CurrentConnectDisconnect, () => {
disconnect_flag = true;
$q.loading.show({
html: true,
message:
@ -53,6 +55,12 @@ export default defineComponent({
EventBus.getInstance().on(EventNamesDefine.CurrentConnectConnected, () => {
$q.loading.hide();
if (disconnect_flag) {
if ($q.platform.is.android && $q.platform.is.capacitor) {
window.location.reload();
return;
}
}
setTimeout(() => {
new Initializer(options).initialize().then(() => {
$store.commit("setInitialized");