Skip to content

Commit b138bf0

Browse files
authoredDec 12, 2024··
Merge pull request #1 from arduino/persitence
Save settings to local storage
2 parents 6913c4d + e74b1a8 commit b138bf0

File tree

2 files changed

+16
-0
lines changed

2 files changed

+16
-0
lines changed
 

‎README.md

+2
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@ Follow the on-screen prompts to download and install the MicroPython firmware.
2626
- Arduino Nano ESP32
2727
- Arduino Nano 33 BLE
2828

29+
**Note:** This tool may work for 3rd party boards too. This is however not officially supported.
30+
2931
## ⚙️ Installation
3032

3133
You can download the binary for your operating system from the [release page](https://github.com/arduino/lab-micropython-package-installer/releases).

‎renderer.js

+14
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,20 @@ document.addEventListener('DOMContentLoaded', async () => {
2929
// Show loading spinner
3030
packageList.innerHTML = '<div class="loading-spinner primary" style="margin: 50px auto;"></div>';
3131

32+
// Load initial state of the checkboxes from local storage
33+
compileFilesCheckbox.checked = localStorage.getItem('compileFiles') === 'true';
34+
overwriteExistingCheckbox.checked = localStorage.getItem('overwriteExisting') === 'true';
35+
36+
compileFilesCheckbox.addEventListener('change', () => {
37+
// Persist the user's selection in local storage
38+
localStorage.setItem('compileFiles', compileFilesCheckbox.checked);
39+
});
40+
41+
overwriteExistingCheckbox.addEventListener('change', () => {
42+
// Persist the user's selection in local storage
43+
localStorage.setItem('overwriteExisting', overwriteExistingCheckbox.checked);
44+
});
45+
3246
deviceSelectionList.addEventListener("device-selected", (event) => {
3347
selectedDeviceItem = event.target;
3448
console.log("Selected device item:", selectedDeviceItem);

0 commit comments

Comments
 (0)
Please sign in to comment.