mirror of
https://github.com/zulip/zulip.git
synced 2025-11-07 15:33:30 +00:00
navbar_alerts: Delay showing "Complete the organization profile" banner.
Currently, we are displaying the "Complete the organization profile" banner immediately after the organization was created. It's important to strongly encourage orgs to configure their profile, so we should delay showing the banner if the profile has not been configured after 15 days. Thus also allows the users to check out Zulip and see how it works before configuring the organization settings. Fixes: #24122.
This commit is contained in:
@@ -490,3 +490,14 @@ export function get_time_limit_setting_in_appropriate_unit(
|
||||
const time_limit_in_days = Math.floor(time_limit_in_hours / 24);
|
||||
return {value: time_limit_in_days, unit: "day"};
|
||||
}
|
||||
|
||||
export function should_display_profile_incomplete_alert(timestamp: number): boolean {
|
||||
const today = new Date(Date.now());
|
||||
const time = new Date(timestamp);
|
||||
const days_old = differenceInCalendarDays(today, time);
|
||||
|
||||
if (days_old >= 15) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user