mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-02 22:30:31 +00:00
LibWeb: Store IndexedDB Databases mappings properly
This commit is contained in:
parent
1656d8fe07
commit
932fb2024e
Notes:
github-actions[bot]
2024-11-26 13:51:43 +00:00
Author: https://github.com/stelar7
Commit: 932fb2024e
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/2236
Reviewed-by: https://github.com/gmta ✅
2 changed files with 12 additions and 4 deletions
|
@ -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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue