When I logged in I want to display a pop message

I write a pop message for display immediate after login.
when I run the following in the bench console.

Apps in this namespace:
frappe, erpnext, hrms, payments, education, agriculture, healthcare, pdf_on_submit, my_print, chat, late_minutes, icfosserp, icfoss_dashboard, custom_dashboard_app, asset_sla, frappe_whatsapp, mytask

In [1]: from late_minutes.login_reminder import check_recent_absents
…:
…: class FakeLoginManager:
…: user = “arunad@icfoss.org
…:
…: check_recent_absents(FakeLoginManager())

In [2]:

It works as in the screenshot

But when I log out and again logged in , it does not shown…

My hooks.py are as follows

on_login = “late_minutes.login_reminder.check_recent_absents”
app_include_js = “/assets/late_minutes/js/desk.js”

I request all of you to help me if any one knew the solution.

@ArunaDevraj

You can achieve this by overriding the frappe.Application class in your custom app’s desk.js. Specifically, override the startup() method to display your dialog box right after login. Here’s how I did it:

frappe.Application = class Application {
	constructor() {
		this.startup();
	}

	startup() {
		this.show_reminder_dialog();
	}

	show_reminder_dialog() {
		frappe.msgprint({
			title: __("Reminder"),
			message: __("You have recent absents. Please check your attendance."),
			indicator: "orange"
		});
	}
}

:white_check_mark: This works because startup() is called once immediately after login and page load.
:no_entry_sign: Just using on_login in hooks.py doesn’t guarantee your dialog appears on the front end — it’s server-side.

I added this to my app’s public/js/desk.js, and included it via app_include_js in hooks.py.