Skip to content

Commit

Permalink
Improved indentation
Browse files Browse the repository at this point in the history
  • Loading branch information
disha1202 committed Jan 12, 2022
1 parent 59c3f49 commit 6f870d1
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 30 deletions.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,8 @@
"core-js": "^3.6.5",
"file-saver": "^2.0.5",
"http-status-codes": "^2.1.4",
"luxon": "^2.3.0",
"mitt": "^2.1.0",
"moment": "^2.29.1",
"moment-timezone": "^0.5.33",
"vue": "^3.0.0-0",
"vue-i18n": "^9.0.0",
"vue-router": "^4.0.0-0",
Expand All @@ -36,6 +35,7 @@
"@capacitor/cli": "^2.4.7",
"@intlify/vue-i18n-loader": "^2.1.0",
"@types/jest": "^24.0.19",
"@types/luxon": "^2.0.9",
"@typescript-eslint/eslint-plugin": "^2.33.0",
"@typescript-eslint/parser": "^2.33.0",
"@vue/cli-plugin-babel": "~4.5.0",
Expand Down
26 changes: 13 additions & 13 deletions src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -29,20 +29,20 @@ export default defineComponent({
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("Dismiss"),
role: 'cancel',
cssClass: 'secondary'
},
{
text: this.$t("Update time zone"),
handler: () => {
this.store.dispatch("user/setUserTimeZone", {
"tzId": payload.localTimeZone
});
},
{
text: this.$t("Update time zone"),
handler: () => {
this.store.dispatch("user/setUserTimeZone", {
"tzId": payload.localTimeZone
});
},
},
],
},
],
});
return alert.present();
},
Expand Down
5 changes: 2 additions & 3 deletions src/store/modules/user/actions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,8 @@ import UserState from './UserState'
import * as types from './mutation-types'
import { hasError, showToast } from '@/utils'
import { translate } from '@/i18n'
import moment from 'moment';
import emitter from '@/event-bus'
import "moment-timezone";
import { DateTime } from 'luxon';

const actions: ActionTree<UserState, RootState> = {

Expand Down Expand Up @@ -55,7 +54,7 @@ const actions: ActionTree<UserState, RootState> = {
async getProfile ( { commit }) {
const resp = await UserService.getProfile()
if (resp.status === 200) {
const localTimeZone = moment.tz.guess();
const localTimeZone = DateTime.local().zoneName;
if (resp.data.userTimeZone !== localTimeZone) {
emitter.emit('timeZoneDifferent', { profileTimeZone: resp.data.userTimeZone, localTimeZone});
}
Expand Down
22 changes: 10 additions & 12 deletions src/views/TimezoneModal.vue
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,6 @@ export default defineComponent({
timeZoneId: ''
}
},
computed: {
},
methods: {
closeModal() {
modalController.dismiss({ dismissed: true });
Expand All @@ -88,16 +86,16 @@ export default defineComponent({
header: this.$t("Update time zone"),
message,
buttons: [
{
text: this.$t("Cancel"),
},
{
text: this.$t("Confirm"),
handler: () => {
this.setUserTimeZone();
}
}
],
{
text: this.$t("Cancel"),
},
{
text: this.$t("Confirm"),
handler: () => {
this.setUserTimeZone();
}
}
],
});
return alert.present();
},
Expand Down

0 comments on commit 6f870d1

Please sign in to comment.