mirror of
https://github.com/streetwriters/notesnook.git
synced 2026-09-03 12:41:45 +02:00
feat: remove defer function prototype hack
This commit is contained in:
@@ -1,6 +1,5 @@
|
||||
import "react-app-polyfill/ie11";
|
||||
import "react-app-polyfill/ie9";
|
||||
import "./utils/defer";
|
||||
import "./utils/dimensions";
|
||||
import React from "react";
|
||||
import ReactDOM from "react-dom";
|
||||
|
||||
@@ -69,7 +69,7 @@ class NoteStore extends BaseStore {
|
||||
|
||||
favorite = async (note) => {
|
||||
await db.notes.note(note).favorite();
|
||||
this.refreshContext.defer();
|
||||
setTimeout(() => this.refreshContext(), 0);
|
||||
this._setValue(note.id, "favorite", !note.favorite);
|
||||
};
|
||||
|
||||
|
||||
@@ -1,9 +0,0 @@
|
||||
function defer() {
|
||||
setTimeout(this, 0);
|
||||
}
|
||||
|
||||
// eslint-disable-next-line no-extend-native
|
||||
Object.defineProperty(Function.prototype, "defer", {
|
||||
value: defer,
|
||||
writable: false,
|
||||
});
|
||||
Reference in New Issue
Block a user