update ui changes
This commit is contained in:
@@ -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],
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user