Update error messages to reflect valid data checks and improve user feedback in task and calendar dialogs. see #333
This commit is contained in:
parent
fca3333d5f
commit
775882de23
2 changed files with 10 additions and 4 deletions
|
|
@ -1111,8 +1111,8 @@
|
|||
"message": "Error opening the task dialog",
|
||||
"description": ""
|
||||
},
|
||||
"sparks_not_installed": {
|
||||
"message": "ThunderAI Sparks not installed!",
|
||||
"no_valid_data_received": {
|
||||
"message": "No valid data recevied from the AI.",
|
||||
"description": ""
|
||||
},
|
||||
"prefs_OptionText_add_tags_auto": {
|
||||
|
|
|
|||
|
|
@ -260,7 +260,7 @@ export class mzta_Menus {
|
|||
}
|
||||
}catch(err){
|
||||
console.error("[ThunderAI] Error opening calendar event dialog: ", err);
|
||||
browser.tabs.sendMessage(tabs[0].id, { command: "sendAlert", curr_tab_type: tabs[0].type, message: browser.i18n.getMessage("calendar_opening_dialog_error") + ": " + browser.i18n.getMessage("sparks_not_installed") });
|
||||
browser.tabs.sendMessage(tabs[0].id, { command: "sendAlert", curr_tab_type: tabs[0].type, message: browser.i18n.getMessage("calendar_opening_dialog_error") + ": " + browser.i18n.getMessage("no_valid_data_received") });
|
||||
taWorkingStatus.stopWorking();
|
||||
return {ok:'0'};
|
||||
}
|
||||
|
|
@ -296,6 +296,12 @@ export class mzta_Menus {
|
|||
let task_data_obj = {};
|
||||
try{
|
||||
task_data_obj = extractJsonObject(task_data);
|
||||
if (!task_data_obj.dueDate || isNaN(Date.parse(task_data_obj.dueDate)) || task_data_obj.dueDate == '' ) {
|
||||
delete task_data_obj.dueDate;
|
||||
}
|
||||
if (!task_data_obj.InitialDate || isNaN(Date.parse(task_data_obj.InitialDate)) || task_data_obj.InitialDate == '' ) {
|
||||
delete task_data_obj.InitialDate;
|
||||
}
|
||||
}catch(err){
|
||||
console.error("[ThunderAI] Error extracting JSON object from task data: ", err.message);
|
||||
browser.tabs.sendMessage(tabs[0].id, { command: "sendAlert", curr_tab_type: tabs[0].type, message: browser.i18n.getMessage("task_getting_data_error") + ": " + err.message });
|
||||
|
|
@ -328,7 +334,7 @@ export class mzta_Menus {
|
|||
}
|
||||
}catch(err){
|
||||
console.error("[ThunderAI] Error opening task dialog: ", err);
|
||||
browser.tabs.sendMessage(tabs[0].id, { command: "sendAlert", curr_tab_type: tabs[0].type, message: browser.i18n.getMessage("task_opening_dialog_error") + ": " + browser.i18n.getMessage("sparks_not_installed") });
|
||||
browser.tabs.sendMessage(tabs[0].id, { command: "sendAlert", curr_tab_type: tabs[0].type, message: browser.i18n.getMessage("task_opening_dialog_error") + ": " + browser.i18n.getMessage("no_valid_data_received") });
|
||||
taWorkingStatus.stopWorking();
|
||||
return {ok:'0'};
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue