mirror of
https://github.com/TandoorRecipes/recipes.git
synced 2026-01-03 13:19:16 -05:00
fixed device setting supermarkt refresh
This commit is contained in:
@@ -9,15 +9,15 @@
|
||||
|
||||
<b-tabs content-class="mt-2" v-model="current_tab" class="mt-md-1" style="margin-bottom: 20vh">
|
||||
<template #tabs-end>
|
||||
<li class="nav-item flex-grow-1" >
|
||||
<li class="nav-item flex-grow-1">
|
||||
|
||||
</li>
|
||||
<li class="nav-item" >
|
||||
<li class="nav-item">
|
||||
<a href="#" class="nav-link" @click="useShoppingListStore().undoChange()"> <i class="fas fa-undo fa-fw"></i> </a>
|
||||
</li>
|
||||
<li class="nav-item dropdown d-none d-md-inline-block" >
|
||||
<li class="nav-item dropdown d-none d-md-inline-block">
|
||||
<a class="nav-link dropdown-toggle" href="#" role="button" data-toggle="dropdown" aria-expanded="false">
|
||||
<i class="fas fa-download" ></i>
|
||||
<i class="fas fa-download"></i>
|
||||
</a>
|
||||
<div class="dropdown-menu">
|
||||
<DownloadPDF dom="#shoppinglist" name="shopping.pdf" :label="$t('download_pdf')"
|
||||
@@ -34,7 +34,7 @@
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a href="#" class="nav-link" id="id_filters_button">
|
||||
<i class="fas fa-filter fa-fw"/>
|
||||
<i class="fas fa-filter fa-fw"/>
|
||||
</a>
|
||||
</li>
|
||||
</template>
|
||||
@@ -351,7 +351,7 @@
|
||||
<template #title>
|
||||
<div class="d-print-none">
|
||||
<i class="fas fa-user-cog fa-fw"></i>
|
||||
<!-- <span class="d-none d-lg-inline-block ml-1">{{ $t('Settings') }}</span>-->
|
||||
<!-- <span class="d-none d-lg-inline-block ml-1">{{ $t('Settings') }}</span>-->
|
||||
</div>
|
||||
</template>
|
||||
<div class="row justify-content-center">
|
||||
@@ -562,6 +562,16 @@ export default {
|
||||
this.shopping_list_store.refreshFromAPI()
|
||||
useUserPreferenceStore().loadUserSettings(true)
|
||||
useUserPreferenceStore().loadDeviceSettings()
|
||||
|
||||
// update selected supermarkt because local setting become stale otherwise
|
||||
if (useUserPreferenceStore().device_settings.shopping_selected_supermarket != null) {
|
||||
let api = new ApiApiFactory()
|
||||
api.retrieveSupermarket(useUserPreferenceStore().device_settings.shopping_selected_supermarket.id).then(r => {
|
||||
useUserPreferenceStore().device_settings.shopping_selected_supermarket = r.data
|
||||
useUserPreferenceStore().updateDeviceSettings()
|
||||
})
|
||||
}
|
||||
|
||||
this.autoSyncLoop()
|
||||
},
|
||||
methods: {
|
||||
@@ -693,6 +703,10 @@ export default {
|
||||
apiClient.updateSupermarket(this.shopping_list_store.supermarkets[index].id, this.shopping_list_store.supermarkets[index]).then((r) => {
|
||||
StandardToasts.makeStandardToast(this, StandardToasts.SUCCESS_UPDATE)
|
||||
this.shopping_list_store.refreshFromAPI()
|
||||
|
||||
if (r.data.id === useUserPreferenceStore().device_settings.shopping_selected_supermarket.id){
|
||||
useUserPreferenceStore().device_settings.shopping_selected_supermarket = r.data
|
||||
}
|
||||
}).catch((err) => {
|
||||
StandardToasts.makeStandardToast(this, StandardToasts.FAIL_UPDATE, err)
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user