Skip to content

Commit

Permalink
Saved vault name will now be shown in options page
Browse files Browse the repository at this point in the history
  • Loading branch information
ClarkAllen1556 committed Apr 15, 2023
1 parent 35ef3e5 commit ea354af
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/html/options.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,12 @@
<link rel="stylesheet" href="../styles/options.css">
</head>
<body>
<form id="clipper_options">
<form id="clipper_options" style="display: flex; gap: 8px; align-items: center">
<label for="clipper_opts_vault_name">Vault name</label>
<input type="text" id="clipper_opts_vault_name" />
<button type="submit">Save</button>
</form>
<div id="message"></div>

<script type="module" src="../scripts/options.js"></script>
</body>
6 changes: 6 additions & 0 deletions src/scripts/options.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
document.getElementById('clipper_options')
.addEventListener('submit', () => saveOptions());

browser.storage.local.get("clipper_opts_vault_name").then(resp => {
const { vaultName, clipper_opts_vault_name } = resp;

document.getElementById('clipper_opts_vault_name').value = clipper_opts_vault_name;
})

function saveOptions(){
const vaultName = document.getElementById('clipper_opts_vault_name').value;

Expand Down

0 comments on commit ea354af

Please sign in to comment.