feat: showing recipe list values
- add displaying for values in recipe list, with some editable fields except topping, string params, feed pattern/level Signed-off-by: pakintada@gmail.com <Pakin>
This commit is contained in:
parent
4866674f26
commit
dbb5ce466c
14 changed files with 640 additions and 37 deletions
|
|
@ -6,7 +6,9 @@ import {
|
|||
recipeDataError,
|
||||
recipeLoading,
|
||||
recipeOverviewData,
|
||||
recipeStreamMeta
|
||||
recipeStreamMeta,
|
||||
toppingGroupFromServerQuery,
|
||||
toppingListFromServerQuery
|
||||
} from '../stores/recipeStore';
|
||||
import { buildOverviewFromServer } from '$lib/data/recipeService';
|
||||
import { auth } from '../client/firebase';
|
||||
|
|
@ -103,18 +105,48 @@ const handlers: Record<string, (payload: any) => void> = {
|
|||
// know type
|
||||
switch (extp) {
|
||||
case 'matset':
|
||||
let curr_mat_query = get(materialFromServerQuery);
|
||||
let curr_mat_query = get(materialFromServerQuery) ?? [];
|
||||
|
||||
if (!curr_mat_query) {
|
||||
curr_mat_query = [];
|
||||
}
|
||||
|
||||
// ex_payload has chunks of material setting
|
||||
for (let m of ex_payload) {
|
||||
let mid = m.id;
|
||||
curr_mat_query[mid] = m;
|
||||
// curr_mat_query[mid] = m;
|
||||
|
||||
curr_mat_query.push(m);
|
||||
}
|
||||
|
||||
// console.log('current materials: ', JSON.stringify(curr_mat_query));
|
||||
materialFromServerQuery.set(curr_mat_query);
|
||||
break;
|
||||
case 'topplist':
|
||||
let curr_topping_list_query = get(toppingListFromServerQuery) ?? [];
|
||||
if (!curr_topping_list_query) {
|
||||
curr_topping_list_query = [];
|
||||
}
|
||||
|
||||
for (let t of ex_payload) {
|
||||
curr_topping_list_query.push(t);
|
||||
}
|
||||
|
||||
toppingListFromServerQuery.set(curr_topping_list_query);
|
||||
|
||||
break;
|
||||
case 'toppgrp':
|
||||
let curr_topping_group_query = get(toppingGroupFromServerQuery) ?? [];
|
||||
if (!curr_topping_group_query) {
|
||||
curr_topping_group_query = [];
|
||||
}
|
||||
|
||||
for (let t of ex_payload) {
|
||||
curr_topping_group_query.push(t);
|
||||
}
|
||||
|
||||
toppingGroupFromServerQuery.set(curr_topping_group_query);
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue