Skip to content

Commit 3269825

Browse files
Modify clinical document file permissions and update storage based on the window focus.
1 parent 9e75966 commit 3269825

18 files changed

+66
-43
lines changed

clinicDocs/001_Notice of Appearance - pro se.pdf

100755100644
File mode changed.

clinicDocs/007_Motion to Expunge Non-Conviction - 7603 Nonstipulated.pdf

100755100644
File mode changed.

clinicDocs/5119(g) Nonstipulated.pdf

100755100644
File mode changed.

clinicDocs/5119(g) Stipulated.pdf

100755100644
File mode changed.

clinicDocs/7602 NonStip.pdf

100755100644
File mode changed.

clinicDocs/7602 Stipulated.pdf

100755100644
File mode changed.

clinicDocs/7603 stipulated.pdf

100755100644
File mode changed.

extensionDirectory/components/filings.vue

100755100644
Lines changed: 32 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -30,14 +30,15 @@ const maxCountsOnNoA = 10;
3030
function detectChangesInChromeStorage(app) {
3131
chrome.storage.onChanged.addListener(function (changes, namespace) {
3232
var countsChange = changes['counts'];
33-
var responsesChange = changes['responses'];
34-
33+
var responsesChange = changes['responses']
3534
if (countsChange === undefined && responsesChange === undefined) return;
36-
// if (countsChange.newValue === undefined) {
37-
// app.clearAll();
38-
// return;
39-
// }
40-
app.loadAll(function () {});
35+
if (countsChange.newValue === undefined) {
36+
app.clearAll();
37+
return;
38+
}
39+
if (!document.hasFocus()) {
40+
app.loadAll(function () { });
41+
}
4142
});
4243
}
4344
@@ -169,19 +170,27 @@ export default {
169170
saveSettings: function () {
170171
// devLog("save settings", this.settings)
171172
settingString = JSON.stringify(this.settings);
172-
localStorage.setItem('localExpungeVTSettings', settingString);
173+
if (document.hasFocus()) {
174+
localStorage.setItem('localExpungeVTSettings', settingString);
175+
}
173176
},
174177
saveResponses: function () {
175-
devLog('save responses' + getError());
176-
chrome.storage.local.set({
177-
responses: this.responses,
178-
});
178+
devLog(
179+
'save responses' + getError()
180+
);
181+
if (document.hasFocus()) {
182+
chrome.storage.local.set({
183+
responses: this.responses,
184+
});
185+
}
179186
},
180187
saveCounts: function () {
181188
devLog('saving counts');
182-
chrome.storage.local.set({
183-
counts: toRaw(this.saved),
184-
});
189+
if (document.hasFocus()) {
190+
chrome.storage.local.set({
191+
counts: toRaw(this.saved),
192+
});
193+
}
185194
},
186195
handleNewDocketNums: function (sheetNum) {
187196
if (sheetNum.toLowerCase().includes('-cr-')) {
@@ -224,13 +233,10 @@ export default {
224233
}
225234
226235
callback();
227-
// nextTick(function () {
228-
// // call any vanilla js functions that need to run after vue is all done setting up.
229-
// initAfterVue();
230-
// });
231-
// setTimeout(() => {
232-
// initAfterVue();
233-
// }, 0);
236+
//this.$nextTick(function () {
237+
//call any vanilla js functions that need to run after vue is all done setting up.
238+
//initAfterVue();
239+
//});
234240
});
235241
},
236242
@@ -380,11 +386,11 @@ export default {
380386
381387
// when the county changes, insert a NOA
382388
if (lastCounty != currCounty) {
383-
const counts = filings
389+
const docketCounts = filings
384390
.filter((f) => f.county == currCounty)
385391
.map((f) => f.counts)
386392
.flat();
387-
const noa = this.createNOAFiling(currCounty, counts);
393+
const noa = this.createNOAFiling(currCounty, docketCounts);
388394
filingsWithNOAs.push(noa);
389395
390396
if (this.responses[noa.id + '-feeForm'] === undefined) {
@@ -1273,9 +1279,9 @@ export default {
12731279
<!-- If there are filings to dispalay... -->
12741280
<div v-if="(numCountsToExpungeOrSeal + numCountsNoAction) > 0">
12751281
<!-- Page header & page actions -->
1276-
<div v-if="petitioner.name" class="header-bar-wrapper no-print">
1282+
<div class="header-bar-wrapper no-print">
12771283
<div class="header-bar">
1278-
<h1>Filings for {{petitioner.name}}</h1>
1284+
<h1 v-if="petitioner.name" >Filings for {{petitioner.name}}</h1>
12791285
<div class="header-bar__controls">
12801286
<div v-if="numDockets >= 1 && proSeFromRole(settings.role)">
12811287
<span

extensionDirectory/components/manage-counts.vue

100755100644
Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,9 @@ function detectChangesInChromeStorage(app) {
1919
app.clearAll();
2020
return;
2121
}
22-
app.loadAll(function () { });
22+
if (!document.hasFocus()) {
23+
app.loadAll(function () { });
24+
}
2325
});
2426
}
2527
@@ -135,18 +137,23 @@ export default {
135137
saveSettings: function () {
136138
// devLog("save settings", this.settings)
137139
settingString = JSON.stringify(this.settings);
138-
localStorage.setItem('localExpungeVTSettings', settingString);
140+
if (document.hasFocus()) {
141+
localStorage.setItem('localExpungeVTSettings', settingString);
142+
}
139143
},
140144
saveResponses: function () {
141145
devLog(
142146
'save responses' + getError()
143147
);
144-
chrome.storage.local.set({
145-
responses: this.responses,
146-
});
148+
if (document.hasFocus()) {
149+
chrome.storage.local.set({
150+
responses: this.responses,
151+
});
152+
}
147153
},
148154
saveCounts: function () {
149155
devLog(`saving counts: ${JSON.stringify(this.saved)}`);
156+
if (document.hasFocus())
150157
chrome.storage.local.set({
151158
counts: toRaw(this.saved),
152159
});
@@ -373,9 +380,9 @@ export default {
373380

374381
<template>
375382
<div>
376-
<div v-if="petitioner.name" class="header-bar-wrapper no-print">
383+
<div class="header-bar-wrapper no-print">
377384
<div class="header-bar">
378-
<h1>Counts for {{petitioner.name}}</h1>
385+
<h1 v-if="petitioner.name">Counts for {{petitioner.name}}</h1>
379386
<div class="header-bar__controls">
380387
<button v-on:click="newCount" class="btn btn-primary">
381388
Add Count <i class="fas fa-plus-circle"></i>

extensionDirectory/components/popup.vue

Lines changed: 20 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,9 @@ function detectChangesInChromeStorage(app) {
1919
app.clearAll();
2020
return;
2121
}
22-
app.loadAll(function () {});
22+
if (!document.hasFocus() || toRaw(app.saved.counts).length === 0 && Object.keys(toRaw(app.responses)).length === 0) {
23+
app.loadAll(function () { });
24+
}
2325
});
2426
}
2527
@@ -91,7 +93,7 @@ export default {
9193
handler() {
9294
this.saveSettings();
9395
//this.$nextTick(function () {
94-
//vanilla js
96+
//vanilla js
9597
//});
9698
},
9799
deep: true,
@@ -139,19 +141,27 @@ export default {
139141
saveSettings: function () {
140142
// devLog("save settings", this.settings)
141143
settingString = JSON.stringify(this.settings);
142-
localStorage.setItem('localExpungeVTSettings', settingString);
144+
if (document.hasFocus()) {
145+
localStorage.setItem('localExpungeVTSettings', settingString);
146+
}
143147
},
144148
saveResponses: function () {
145-
devLog('save responses' + getError());
146-
chrome.storage.local.set({
147-
responses: this.responses,
148-
});
149+
devLog(
150+
'save responses' + getError()
151+
);
152+
if (document.hasFocus()) {
153+
chrome.storage.local.set({
154+
responses: this.responses,
155+
});
156+
}
149157
},
150158
saveCounts: function () {
151159
devLog('saving counts');
152-
chrome.storage.local.set({
153-
counts: toRaw(this.saved),
154-
});
160+
if (document.hasFocus()) {
161+
chrome.storage.local.set({
162+
counts: toRaw(this.saved),
163+
});
164+
}
155165
},
156166
loadAll: function (callback) {
157167
var self = this;

0 commit comments

Comments
 (0)