Skip to content

Commit

Permalink
Improved: syntax for if and method
Browse files Browse the repository at this point in the history
  • Loading branch information
amansinghbais committed Nov 15, 2023
1 parent b817e98 commit 85c09e7
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions src/store/modules/user/actions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -136,12 +136,12 @@ const actions: ActionTree<UserState, RootState> = {
/**
* Update user timeZone
*/
async setUserTimeZone ( { state, commit }, payload) {
async setUserTimeZone({ state, commit }, payload) {
const current: any = state.current;
// if set the same timezone again, no API call should happen
if(current.userTimeZone !== payload.tzId){
if(current.userTimeZone !== payload.tzId) {
const resp = await UserService.setUserTimeZone(payload)
if (resp.status === 200 && !hasError(resp)) {
if(resp.status === 200 && !hasError(resp)) {
current.userTimeZone = payload.tzId;
commit(types.USER_INFO_UPDATED, current);
Settings.defaultZone = current.userTimeZone;
Expand Down
4 changes: 2 additions & 2 deletions src/views/timezone-modal.vue
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,12 @@
<form @keyup.enter="setUserTimeZone">
<div class="empty-state" v-if="isLoading">
<ion-spinner name="crescent" />
<p>{{ $t("Fetching TimeZones")}}</p>
<p>{{ $t("Fetching TimeZones") }}</p>
</div>

<!-- Empty state -->
<div class="empty-state" v-else-if="filteredTimeZones.length === 0">
<p>{{ $t("No time zone found")}}</p>
<p>{{ $t("No time zone found") }}</p>
</div>

<!-- Timezones -->
Expand Down

0 comments on commit 85c09e7

Please sign in to comment.