LibWeb/IDB: Use helper method for checking transaction state

This commit is contained in:
stelar7
2025-05-13 23:14:02 +02:00
committed by Jelle Raaijmakers
parent 4c7c7845d3
commit c8e1b24864
Notes: github-actions[bot] 2025-05-14 15:18:37 +00:00
5 changed files with 31 additions and 28 deletions

View File

@@ -59,6 +59,9 @@ public:
[[nodiscard]] bool is_readonly() const { return m_mode == Bindings::IDBTransactionMode::Readonly; }
[[nodiscard]] bool is_readwrite() const { return m_mode == Bindings::IDBTransactionMode::Readwrite; }
[[nodiscard]] bool is_finished() const { return m_state == TransactionState::Finished; }
[[nodiscard]] bool is_active() const { return m_state == TransactionState::Active; }
[[nodiscard]] bool is_inactive() const { return m_state == TransactionState::Inactive; }
[[nodiscard]] bool is_committing() const { return m_state == TransactionState::Committing; }
GC::Ptr<ObjectStore> object_store_named(String const& name) const;
void add_to_scope(GC::Ref<ObjectStore> object_store) { m_scope.append(object_store); }