mirror of
https://github.com/aiogram/aiogram.git
synced 2026-04-08 16:37:47 +00:00
Update fsm.py
This commit is contained in:
parent
80d294751d
commit
5c9a29547f
1 changed files with 3 additions and 2 deletions
|
|
@ -57,12 +57,13 @@ class FSMSStorageProxy(dict):
|
|||
self._is_dirty = True
|
||||
|
||||
async def save(self, force=False):
|
||||
if self._copy != dict(self) or force:
|
||||
data = dict(self)
|
||||
if self._copy != data or force:
|
||||
await self.fsm_context.set_data(data=self)
|
||||
if self._is_dirty or force:
|
||||
await self.fsm_context.set_state(self.state)
|
||||
self._is_dirty = False
|
||||
self._copy = copy.deepcopy(dict(self))
|
||||
self._copy = copy.deepcopy(data)
|
||||
|
||||
def __str__(self):
|
||||
s = super().__str__()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue