feat: dismiss label suggestions only for 24 hours (#7579)
Co-authored-by: Muhsin Keloth <muhsinkeramam@gmail.com>
This commit is contained in:
@@ -1,7 +1,5 @@
|
||||
import { mapGetters } from 'vuex';
|
||||
import { OPEN_AI_EVENTS } from '../helper/AnalyticsHelper/events';
|
||||
import { LOCAL_STORAGE_KEYS } from '../constants/localStorage';
|
||||
import { LocalStorage } from '../../shared/helpers/localStorage';
|
||||
import OpenAPI from '../api/integrations/openapi';
|
||||
|
||||
export default {
|
||||
@@ -66,29 +64,6 @@ export default {
|
||||
return [];
|
||||
}
|
||||
},
|
||||
getDismissedConversations(accountId) {
|
||||
const suggestionKey = LOCAL_STORAGE_KEYS.DISMISSED_LABEL_SUGGESTIONS;
|
||||
|
||||
// fetch the value from Storage
|
||||
const valueFromStorage = LocalStorage.get(suggestionKey);
|
||||
|
||||
// Case 1: the key is not initialized
|
||||
if (!valueFromStorage) {
|
||||
LocalStorage.set(suggestionKey, {
|
||||
[accountId]: [],
|
||||
});
|
||||
return LocalStorage.get(suggestionKey);
|
||||
}
|
||||
|
||||
// Case 2: the key is initialized, but account ID is not present
|
||||
if (!valueFromStorage[accountId]) {
|
||||
valueFromStorage[accountId] = [];
|
||||
LocalStorage.set(suggestionKey, valueFromStorage);
|
||||
return LocalStorage.get(suggestionKey);
|
||||
}
|
||||
|
||||
return valueFromStorage;
|
||||
},
|
||||
cleanLabels(labels) {
|
||||
return labels
|
||||
.toLowerCase() // Set it to lowercase
|
||||
|
||||
Reference in New Issue
Block a user