mirror of
https://github.com/Azure/cosmos-explorer.git
synced 2025-12-19 17:01:13 +00:00
Migrate Most Recent activity local storage to App State persistence (#1967)
* Rewrite MostRecentActivity to leverage AppStatePersistenceUtility. * Fix format. Update type enum. * Migrate Item enum to string enum * Fix unit tests * Fix build issue
This commit is contained in:
@@ -114,7 +114,7 @@ export class SplashScreen extends React.Component<SplashScreenProps> {
|
||||
}
|
||||
|
||||
private clearMostRecent = (): void => {
|
||||
MostRecentActivity.mostRecentActivity.clear(userContext.databaseAccount?.id);
|
||||
MostRecentActivity.clear(userContext.databaseAccount?.name);
|
||||
this.setState({});
|
||||
};
|
||||
|
||||
@@ -498,7 +498,7 @@ export class SplashScreen extends React.Component<SplashScreenProps> {
|
||||
}
|
||||
|
||||
private createRecentItems(): SplashScreenItem[] {
|
||||
return MostRecentActivity.mostRecentActivity.getItems(userContext.databaseAccount?.id).map((activity) => {
|
||||
return MostRecentActivity.getItems(userContext.databaseAccount?.name).map((activity) => {
|
||||
switch (activity.type) {
|
||||
default: {
|
||||
const unknownActivity: never = activity;
|
||||
|
||||
Reference in New Issue
Block a user