mirror of
https://github.com/jjbrunton/Sauci.git
synced 2026-11-01 18:19:43 +00:00
feat: add live draw feature and clean up docs
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
520d0a8444
commit
4c18afaeae
63 files changed
+6728
-12854
No files matched your search
@@ -0,0 +1,22 @@
|
||||
import { Platform } from 'react-native';
|
||||
import { setWidgetData, reloadWidgets } from '../../../../modules/widget-bridge';
|
||||
import type { StrokeSegment } from '../types';
|
||||
import { renderStrokesToBase64 } from './widgetImageExport';
|
||||
|
||||
export async function updateWidget(strokes: StrokeSegment[]): Promise<void> {
|
||||
try {
|
||||
const base64 = renderStrokesToBase64(strokes);
|
||||
if (!base64) return;
|
||||
|
||||
if (Platform.OS === 'ios') {
|
||||
setWidgetData('LiveDrawImage', base64);
|
||||
reloadWidgets();
|
||||
} else if (Platform.OS === 'android') {
|
||||
setWidgetData('LiveDrawImage', base64);
|
||||
reloadWidgets();
|
||||
}
|
||||
} catch (e) {
|
||||
// Widget update is non-critical; don't crash the app
|
||||
console.warn('Failed to update widget:', e);
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user