MCPcopy Create free account
hub / github.com/Acode-Foundation/Acode / backupRestore

Function backupRestore

src/settings/backupRestore.js:137–344  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

135}
136
137function backupRestore() {
138 const title =
139 strings.backup.capitalize() + "/" + strings.restore.capitalize();
140 const items = [
141 {
142 key: "backup",
143 text: strings.backup.capitalize(),
144 icon: "file_downloadget_app",
145 chevron: true,
146 },
147 {
148 key: "restore",
149 text: strings.restore.capitalize(),
150 icon: "historyrestore",
151 chevron: true,
152 },
153 {
154 note: strings["backup/restore note"],
155 },
156 ];
157
158 return settingsPage(title, items, callback, undefined, {
159 preserveOrder: true,
160 pageClassName: "detail-settings-page",
161 listClassName: "detail-settings-list",
162 groupByDefault: true,
163 });
164
165 function callback(key) {
166 switch (key) {
167 case "backup":
168 backup();
169 return;
170
171 case "restore":
172 restore();
173 return;
174
175 default:
176 break;
177 }
178 }
179
180 async function backup() {
181 const loaderDialog = loader.create(
182 strings.backup.capitalize(),
183 strings["preparing backup"],
184 );
185
186 try {
187 loaderDialog.show();
188 loaderDialog.setMessage(strings["collecting settings"]);
189
190 const settings = appSettings.value;
191
192 // Read keybindings with fallback
193 loaderDialog.setMessage(strings["collecting key bindings"]);
194 let keyBindings = null;

Callers

nothing calls this directly

Calls 1

capitalizeMethod · 0.80

Tested by

no test coverage detected