mirror of
https://github.com/PR0M3TH3AN/bitvid.git
synced 2026-11-05 20:32:27 +00:00
fix(storage): make Blossom actually usable in the upload modal [LOCAL] (#30)
Two root causes for "Blossom set as default but not showing / not usable": 1. SAVE required unlock. saveConnection throws "Storage is locked" without a master key — but Blossom has no secret. Added storageService.saveKeylessConnection() (writes plaintext meta, no encryption, no unlock) and the Blossom save branch now uses it. So a Blossom connection saves even if the user never unlocked storage. 2. UploadModal treated Blossom like a locked S3 connection: it only set activeCredentials when isStorageUnlocked, showed "Locked 🔒", blocked the file-pick behind an unlock prompt, and mislabeled it "S3 Compatible". Now: getProviderLabel → "Blossom"; loadFromStorage resolves servers from the plaintext meta (no unlock); the summary shows "N servers / Nostr-native"; the two upload gates and updateLockUi bypass unlock for Blossom (activeProviderIsBlossom). Uploads authorize with the Nostr signer instead. Bumped UploadModal size baseline (+gating code). Lint + build clean. Local only. Co-Authored-By: Claude Opus 4.8 <[email protected]>
This commit is contained in:
1 parent
5935702e75
commit
ba62b35ada
4 files changed
+78
-21
No files matched your search
@@ -805,25 +805,18 @@ export class ProfileStorageController {
|
||||
const isDefaultBlossom = this.storageDefaultInput?.checked || false;
|
||||
this.setStorageFormStatus("Saving...", "info");
|
||||
try {
|
||||
await saveProviderConnection(storageService, pubkey, {
|
||||
// Keyless: no secret to encrypt, so no storage unlock needed.
|
||||
await storageService.saveKeylessConnection(pubkey, BLOSSOM_PROVIDER, {
|
||||
provider: BLOSSOM_PROVIDER,
|
||||
payload: { provider: BLOSSOM_PROVIDER },
|
||||
meta: {
|
||||
provider: BLOSSOM_PROVIDER,
|
||||
servers,
|
||||
defaultForUploads: isDefaultBlossom,
|
||||
label: `Blossom (${servers.length} server${servers.length === 1 ? "" : "s"})`,
|
||||
},
|
||||
isDefault: isDefaultBlossom,
|
||||
servers,
|
||||
defaultForUploads: isDefaultBlossom,
|
||||
label: `Blossom (${servers.length} server${servers.length === 1 ? "" : "s"})`,
|
||||
});
|
||||
this.setStorageFormStatus("Blossom servers saved.", "success");
|
||||
this.mainController.showSuccess("Blossom storage saved.");
|
||||
} catch (error) {
|
||||
devLogger.error("Failed to save Blossom connection:", error);
|
||||
this.setStorageFormStatus(
|
||||
"Failed to save Blossom servers. Unlock storage first if prompted.",
|
||||
"error",
|
||||
);
|
||||
this.setStorageFormStatus("Failed to save Blossom servers.", "error");
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user