Hi, I have a problem with the time tracking application that I want to implement in my company.
The purpose of this app as the name suggests is to log in and out each user and get a total of hours spent logged in. My database is in a SharePoint list.

The Sharepoint list is called "Project Time Records".
Fields:
Title: automatically pulls the users' emails as it is synchronized with the organization.
Start Time: Type Date and time is the start of the clocking.
End Time: Type Date and time is the end of the clocking.
Time Spent: It makes a total count of minutes that someone has been connected. Inside the application I have a converter that changes it from minutes to hours and minutes.
I have two main buttons: ButonStart (who is in charge of starting the time control) and ButonEnd (who finishes it) I also have fields like active session that is a field of yes or no where it warns if you have started the control or not.
Every time I hit ButonStart or ButonEnd it is disabled until the other has not been selected. To
avoid false registrations or user errors.


The problem is that when I refresh the browser page (I don't want to implement this tool in Microsoft Teams) it re-enables all the buttons and the record ends up as incomplete. Is there any way to be able to keep the state of the buttons despite refreshing the page, as I find it a bad idea that a user can close or refresh the browser window unintentionally and the record he/she has made remains as incomplete.
ButonStart:
Set(
varNewItem;
Patch(
'Project Time Records';
Defaults('Project Time Records');
{
Title: User().Email;
Project: DataCardValue3_1.Selected;
'Start Time': Now();
'Active Session': true
}
)
);;
Set(
StartTime;
Now()
)
ButonEnd:
Set(
varNewItem;
Patch(
'Project Time Records';
LookUp(
'Project Time Records';
varNewItem.ID = ID
);
{
'End Time': Now();
'Time Spent': DateDiff(
varNewItem.'Start Time';
Now();
TimeUnit.Minutes
);
'Active Session': false
}
)
);;
And in the Onstart rule of the App
If(
varNewItem.'Active Session' = true;
DisplayMode.Disabled;
DisplayMode.Edit
);;
Set(
varButtonStartActive;
false
);;
I have used collections, global variables... but nothing seems to work or I am told that it is only supported in mobile version and my goal is a browser window to force the user to use their computer. Any help would be great. @RandyHayes @phipps0218 @WarrenBelz @developerAJ @Ethan_R @Amik