mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-04-28 02:27:19 +02:00
LibWeb: Store IndexedDB Databases mappings properly
This commit is contained in:
committed by
Jelle Raaijmakers
parent
1656d8fe07
commit
932fb2024e
Notes:
github-actions[bot]
2024-11-26 13:51:43 +00:00
Author: https://github.com/stelar7 Commit: https://github.com/LadybirdBrowser/ladybird/commit/932fb2024ee Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/2236 Reviewed-by: https://github.com/gmta ✅
@@ -40,8 +40,11 @@ WebIDL::ExceptionOr<GC::Ref<IDBDatabase>> open_a_database_connection(JS::Realm&
|
||||
}));
|
||||
|
||||
// 4. Let db be the database named name in storageKey, or null otherwise.
|
||||
auto maybe_db = Database::for_key_and_name(storage_key, name);
|
||||
GC::Ptr<Database> db;
|
||||
auto maybe_db = Database::for_key_and_name(storage_key, name);
|
||||
if (maybe_db.has_value()) {
|
||||
db = maybe_db.value();
|
||||
}
|
||||
|
||||
// 5. If version is undefined, let version be 1 if db is null, or db’s version otherwise.
|
||||
auto version = maybe_version.value_or(maybe_db.has_value() ? maybe_db.value()->version() : 1);
|
||||
|
||||
Reference in New Issue
Block a user