Skip to content

Removing ui.notification() from the meta card after being notified #2132

Answered by vopani
n-srinidhi asked this question in Q&A
Discussion options

You must be logged in to vote

You can either set notification_bar to None at the beginning of the main function (preferred, so that it goes away whenever there is a UI change) or you could set a manual sleep timer. There are other ways of handling it too (like an async subprocess to remove the notification bar).

eg:

# Show notification
timeout = 5
q.page['meta'].notification_bar=ui.notification_bar(
    text='User logged out successfully..',
    type='success',
    position='top-right',
    name='notif_logout',
    timeout=timeout,
)
await q.page.save()
await q.sleep(timeout)
q.page['meta'].notification_bar=None
await q.page.save()

Replies: 1 comment 4 replies

Comment options

You must be logged in to vote
4 replies
@n-srinidhi
Comment options

@vopani
Comment options

Answer selected by n-srinidhi
@mturoci
Comment options

@n-srinidhi
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants