Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Removed timezone mismatch alert on login(2893rqm) #36

Merged
merged 3 commits into from
May 11, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 1 addition & 25 deletions src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
import Menu from '@/components/Menu.vue';
import { IonApp, IonRouterOutlet, IonSplitPane } from '@ionic/vue';
import { defineComponent } from 'vue';
import { loadingController, alertController } from '@ionic/vue';
import { loadingController } from '@ionic/vue';
import { useStore } from "./store";
import emitter from "@/event-bus"
export default defineComponent({
Expand All @@ -28,28 +28,6 @@ export default defineComponent({
}
},
methods: {
async timeZoneDifferentAlert(payload: any) {
const alert = await alertController.create({
header: this.$t("Change time zone"),
message: this.$t('Would you like to update your time zone to . Your profile is currently set to . This setting can always be changed from the settings menu.', { localTimeZone: payload.localTimeZone, profileTimeZone: payload.profileTimeZone }),
buttons: [
{
text: this.$t("Dismiss"),
role: 'cancel',
cssClass: 'secondary'
},
{
text: this.$t("Update time zone"),
handler: () => {
this.store.dispatch("user/setUserTimeZone", {
"tzId": payload.localTimeZone
});
},
},
],
});
return alert.present();
},
async presentLoader() {
if (!this.loader) {
this.loader = await loadingController
Expand All @@ -75,12 +53,10 @@ export default defineComponent({
translucent: true,
backdropDismiss: true
});
emitter.on('timeZoneDifferent', this.timeZoneDifferentAlert);
emitter.on('presentLoader', this.presentLoader);
emitter.on('dismissLoader', this.dismissLoader);
},
unmounted() {
emitter.off('timeZoneDifferent', this.timeZoneDifferentAlert);
emitter.off('presentLoader', this.presentLoader);
emitter.off('dismissLoader', this.dismissLoader);
},
Expand Down
4 changes: 0 additions & 4 deletions src/store/modules/user/actions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,10 +54,6 @@ const actions: ActionTree<UserState, RootState> = {
async getProfile ( { commit }) {
const resp = await UserService.getProfile()
if (resp.status === 200) {
const localTimeZone = DateTime.local().zoneName;
if (resp.data.userTimeZone !== localTimeZone) {
emitter.emit('timeZoneDifferent', { profileTimeZone: resp.data.userTimeZone, localTimeZone});
}
commit(types.USER_INFO_UPDATED, resp.data);
}
},
Expand Down