|
@@ -32,6 +32,7 @@ const rowInbucketHost = document.getElementById('row-inbucket-host');
|
|
|
const inputInbucketHost = document.getElementById('input-inbucket-host');
|
|
const inputInbucketHost = document.getElementById('input-inbucket-host');
|
|
|
const rowInbucketMailbox = document.getElementById('row-inbucket-mailbox');
|
|
const rowInbucketMailbox = document.getElementById('row-inbucket-mailbox');
|
|
|
const inputInbucketMailbox = document.getElementById('input-inbucket-mailbox');
|
|
const inputInbucketMailbox = document.getElementById('input-inbucket-mailbox');
|
|
|
|
|
+const inputDuckToken = document.getElementById('input-duck-token');
|
|
|
const inputRunCount = document.getElementById('input-run-count');
|
|
const inputRunCount = document.getElementById('input-run-count');
|
|
|
|
|
|
|
|
// ============================================================
|
|
// ============================================================
|
|
@@ -95,6 +96,9 @@ async function restoreState() {
|
|
|
if (state.tempApiUrl) {
|
|
if (state.tempApiUrl) {
|
|
|
inputTempApiUrl.value = state.tempApiUrl;
|
|
inputTempApiUrl.value = state.tempApiUrl;
|
|
|
}
|
|
}
|
|
|
|
|
+ if (state.duckToken) {
|
|
|
|
|
+ inputDuckToken.value = state.duckToken;
|
|
|
|
|
+ }
|
|
|
if (state.inbucketHost) {
|
|
if (state.inbucketHost) {
|
|
|
inputInbucketHost.value = state.inbucketHost;
|
|
inputInbucketHost.value = state.inbucketHost;
|
|
|
}
|
|
}
|
|
@@ -437,6 +441,13 @@ for (const evt of ['change', 'input']) {
|
|
|
payload: { tempApiUrl: inputTempApiUrl.value.trim() },
|
|
payload: { tempApiUrl: inputTempApiUrl.value.trim() },
|
|
|
});
|
|
});
|
|
|
});
|
|
});
|
|
|
|
|
+ inputDuckToken.addEventListener(evt, async () => {
|
|
|
|
|
+ await chrome.runtime.sendMessage({
|
|
|
|
|
+ type: 'SAVE_SETTING',
|
|
|
|
|
+ source: 'sidepanel',
|
|
|
|
|
+ payload: { duckToken: inputDuckToken.value.trim() },
|
|
|
|
|
+ });
|
|
|
|
|
+ });
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
inputInbucketHost.addEventListener('change', async () => {
|
|
inputInbucketHost.addEventListener('change', async () => {
|