Fix: Signaturen-Tab lädt erste Identität automatisch
- "Bitte wählen" Placeholder entfernt - Erste Identität wird beim Laden direkt ausgewählt - Signatur wird sofort in den Editor geladen (kein manuelles Umschalten nötig)
This commit is contained in:
@@ -860,7 +860,6 @@
|
||||
<div class="form-group">
|
||||
<label for="sig-identity-select">Identität / E-Mail-Adresse</label>
|
||||
<select id="sig-identity-select" style="width:100%;">
|
||||
<option value="">— Bitte wählen —</option>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -1002,7 +1002,7 @@ function updateSigEditorState(source) {
|
||||
|
||||
async function loadIdentities() {
|
||||
allIdentities = [];
|
||||
sigIdentitySelect.innerHTML = '<option value="">— Bitte wählen —</option>';
|
||||
sigIdentitySelect.innerHTML = '';
|
||||
|
||||
const accounts = await browser.accounts.list();
|
||||
for (const account of accounts) {
|
||||
@@ -1026,10 +1026,24 @@ async function loadIdentities() {
|
||||
}
|
||||
}
|
||||
|
||||
// Auto-select first identity and trigger change
|
||||
if (allIdentities.length > 0 && !sigIdentitySelect.value) {
|
||||
sigIdentitySelect.value = allIdentities[0].id;
|
||||
sigIdentitySelect.dispatchEvent(new Event('change'));
|
||||
// Auto-select first identity and load signature directly
|
||||
if (allIdentities.length > 0) {
|
||||
const first = allIdentities[0];
|
||||
sigIdentitySelect.value = first.id;
|
||||
|
||||
const sourceMap = await getSigSourceMap();
|
||||
const source = sourceMap[first.email.toLowerCase()] || 'own';
|
||||
updateSigSourceDropdown(first.email);
|
||||
sigSourceSelect.value = source;
|
||||
|
||||
if (source.startsWith('=')) {
|
||||
const srcEmail = source.substring(1);
|
||||
const srcIdentity = allIdentities.find(i => i.email.toLowerCase() === srcEmail);
|
||||
sigEditorArea.innerHTML = extractHeader(srcIdentity ? (srcIdentity.signature || '') : '');
|
||||
} else {
|
||||
sigEditorArea.innerHTML = extractHeader(first.signature || '');
|
||||
}
|
||||
updateSigEditorState(source);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1627,7 +1641,7 @@ window.addEventListener('load', async () => {
|
||||
renderTemplates(templates);
|
||||
updateTplSyncIndicator();
|
||||
loadSyncConfig();
|
||||
loadIdentities();
|
||||
await loadIdentities();
|
||||
|
||||
checkForServerUpdates();
|
||||
setInterval(checkForServerUpdates, 30000);
|
||||
|
||||
Reference in New Issue
Block a user