fix: consolidate widget AsyncStorage and debounce expand (#29) #31
1 changed files with 0 additions and 15 deletions
|
|
@ -6,21 +6,6 @@ import { isValidUUID } from '../lib/validation';
|
|||
const EXPAND_DEBOUNCE_MS = 2000;
|
||||
const lastExpandTimes = new Map<string, number>();
|
||||
|
||||
function isWidgetTask(item: unknown): item is WidgetTask {
|
||||
if (typeof item !== 'object' || item === null) return false;
|
||||
const obj = item as Record<string, unknown>;
|
||||
return (
|
||||
typeof obj.id === 'string' &&
|
||||
typeof obj.title === 'string' &&
|
||||
typeof obj.priority === 'number' &&
|
||||
typeof obj.completed === 'boolean' &&
|
||||
(obj.dueDate === null || typeof obj.dueDate === 'string') &&
|
||||
(obj.listColor === null || obj.listColor === undefined || typeof obj.listColor === 'string') &&
|
||||
(obj.subtaskCount === undefined || typeof obj.subtaskCount === 'number') &&
|
||||
(obj.subtaskDoneCount === undefined || typeof obj.subtaskDoneCount === 'number')
|
||||
);
|
||||
}
|
||||
|
||||
function renderWithState(
|
||||
renderWidget: WidgetTaskHandlerProps['renderWidget'],
|
||||
widgetInfo: WidgetTaskHandlerProps['widgetInfo'],
|
||||
|
|
|
|||
Loading…
Reference in a new issue