Skip to content

Commit 8e9acef

Browse files
Gaurav0sivakumar-kailasam
authored andcommitted
better solution
1 parent 951a425 commit 8e9acef

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

app/adapters/application.js

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,23 @@ export default JSONAPIAdapter.extend({
1616
metaStore: service(),
1717
projectService: service('project'),
1818

19+
ids: null,
20+
21+
shouldBackgroundReloadAll() { return false; },
22+
shouldBackgroundReloadRecord(store, snapshot) {
23+
let key = `${snapshot.modelName}-${snapshot.id}`;
24+
let hasId = this.ids[key];
25+
if (!hasId) {
26+
this.ids[key] = true;
27+
}
28+
return !hasId;
29+
},
30+
31+
init() {
32+
this._super(...arguments);
33+
this.ids = {};
34+
},
35+
1936
async findRecord(store, {modelName}, id) {
2037
let url;
2138
let host = this.host;

0 commit comments

Comments
 (0)