some fixes

This commit is contained in:
vabene1111 2024-01-28 20:31:24 +01:00
parent 4724104f50
commit fff2ecd58d
3 changed files with 3 additions and 6 deletions

View File

@ -365,7 +365,6 @@
</div>
</div>
<!-- TODO maybe change to a modal ? -->
<b-popover target="id_filters_button" triggers="click blur" placement="bottomleft" :title="$t('Filters')">
<div>
<b-form-group v-bind:label="$t('GroupBy')" label-for="popover-input-1" label-cols="6" class="mb-1">

View File

@ -56,7 +56,7 @@
<b-button variant="warning" block @click="detail_modal_visible = false; setFoodIgnoredAndChecked(food)"> {{ $t("Ignore_Shopping") }}</b-button>
<b-button variant="info" block
@click="detail_modal_visible = false;useShoppingListStore().delayEntries(entries,!this.is_delayed, true)">
@click="detail_modal_visible = false;useShoppingListStore().delayEntries(entries,!is_delayed, true)">
{{ $t('Postpone') }}
</b-button>
@ -89,7 +89,7 @@
</div>
<b-button variant="warning"
@click="detail_modal_visible = false; useShoppingListStore().deleteObject(e)"><i
class="fas fa-trash"></i></b-button> <!-- TODO implement -->
class="fas fa-trash"></i></b-button>
</b-button-group>
<number-scaler-component :number="e.amount"

View File

@ -37,7 +37,6 @@ export const useShoppingListStore = defineStore(_STORE_ID, {
GROUP_CATEGORY: 'food.supermarket_category.name',
GROUP_CREATED_BY: 'created_by.display_name',
GROUP_RECIPE: 'recipe_mealplan.recipe_name',
GROUP_MEALPLAN: 'recipe_mealplan.mealplan', //TODO give this some name from the API
UNDEFINED_CATEGORY: 'shopping_undefined_category'
}),
@ -368,7 +367,6 @@ export const useShoppingListStore = defineStore(_STORE_ID, {
if (navigator.onLine || document.location.href.includes('localhost')) {
let apiClient = new ApiApiFactory()
let promises = []
//TODO merge entries with same checked state before updating?
for (let i in this.item_check_sync_queue) {
let entry = this.item_check_sync_queue[i]
@ -416,7 +414,7 @@ export const useShoppingListStore = defineStore(_STORE_ID, {
* @param undo if the user should be able to undo the change or not
*/
delayEntries(entries, delay, undo) {
let delay_hours = 4 //TODO get delay from settings in an offline friendly way
let delay_hours = useUserPreferenceStore().user_settings.default_delay
let delay_date = new Date(Date.now() + delay_hours * (60 * 60 * 1000))
if (undo) {