Skip to content

Commit a83874d

Browse files
recorded_actions null fix
1 parent a7b9f74 commit a83874d

File tree

3 files changed

+8
-5
lines changed

3 files changed

+8
-5
lines changed

Apps/Web/AI_Recorder/background/back_reocrder.js

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,10 @@ var action_name_convert = {
2424
}
2525

2626
async function start_recording(){
27-
idx = 0;
28-
recorded_actions = [];
27+
let res = await browserAppData.storage.local.get('recorded_actions');
28+
recorded_actions = res.recorded_actions;
29+
idx = recorded_actions.length;
30+
2931
}
3032
async function stop_recording(){
3133
// When there are 2 iframes. it saves 3 times. this is a temporary fix. Should be fixed properly
@@ -140,7 +142,8 @@ async function record_action(command, value, url, document){
140142
if (Object.keys(action_name_convert).includes(command)) command = action_name_convert[command]
141143
console.log("... Action recorder start");
142144
idx += 1;
143-
if (recorded_actions.length === 0 || recorded_actions.length > 0 && recorded_actions[0].action != 'go to link'){
145+
if (recorded_actions.length === 0 ||
146+
recorded_actions.length > 0 && typeof recorded_actions[0] == 'object' && recorded_actions[0].action != 'go to link'){
144147
let go_to_link = {
145148
action: 'go to link',
146149
data_list: [url],

Apps/Web/AI_Recorder/panel/assets/js/background/recorder.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ class BackgroundRecorder {
5656
}
5757
})
5858
return;
59-
}, 10000)
59+
}, 30000)
6060
}
6161

6262
/* Bind initial time */

Apps/Web/AI_Recorder/panel/assets/js/custom.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ var CustomFunction = {
9090
try {
9191
if (!result.recorded_actions) return;
9292
console.log("result.recorded_actions >>>",result.recorded_actions);
93-
result.recorded_actions = result.recorded_actions.filter(element => ![null, undefined].includes(element));
93+
result.recorded_actions = result.recorded_actions.filter(element => ![null, undefined, 'empty'].includes(element));
9494

9595
// If the step is not totally blank we dont add 'go to link' action
9696
// var shift = false;

0 commit comments

Comments
 (0)