MCPcopy Create free account
hub / github.com/devxnshsharma/UnMessify / exportState

Function exportState

app.js:896–908  ·  view source on GitHub ↗

* Export state as JSON file

(state)

Source from the content-addressed store, hash-verified

894 * Export state as JSON file
895 */
896function exportState(state) {
897 const dataStr = JSON.stringify(state, null, 2);
898 const blob = new Blob([dataStr], { type: 'application/json' });
899 const url = URL.createObjectURL(blob);
900
901 const link = document.createElement('a');
902 link.href = url;
903 link.download = `unmessify_backup_${formatDate(new Date())}.json`;
904 link.click();
905
906 URL.revokeObjectURL(url);
907 showToast('Data exported successfully!', 'success');
908}
909
910/**
911 * Import state from JSON file

Callers 1

setupEventListenersMethod · 0.85

Calls 2

formatDateFunction · 0.85
showToastFunction · 0.85

Tested by

no test coverage detected