update ui changes

This commit is contained in:
2026-09-28 16:35:34 +05:30
parent 88f658fba9
commit f6d81ceaa8
87 changed files with 7157 additions and 1237 deletions

View File

@@ -17,6 +17,17 @@ import type {Scope} from '@/shared/services/httpClient';
* this reference, but a stable object keeps it out of other dependency arrays.
*/
export function useScope(): Scope {
const {storeId, range} = useWorkspace();
return useMemo(() => ({storeId, range}), [storeId, range]);
const {storeId, range, customRange} = useWorkspace();
const from = customRange?.start;
const to = customRange?.end;
return useMemo(
() => ({
storeId,
range,
// Picked dates travel only with a custom range; they are the calendar
// days the merchant chose, as plain strings, so no zone can shift them.
custom: range === 'custom' && from && to ? {from, to} : null,
}),
[storeId, range, from, to],
);
}