mirror of
https://github.com/streetwriters/notesnook.git
synced 2025-12-23 23:19:40 +01:00
fix: properly change host via db.host method
This commit is contained in:
@@ -25,7 +25,7 @@
|
||||
* Syncing should pause until all the conflicts have been resolved
|
||||
* And then it should continue.
|
||||
*/
|
||||
import { HOST, HEADERS } from "../../utils/constants";
|
||||
import Constants from "../../utils/constants";
|
||||
import Collector from "./collector";
|
||||
import Merger from "./merger";
|
||||
import { areAllEmpty } from "./utils";
|
||||
@@ -46,8 +46,8 @@ export default class Sync {
|
||||
}
|
||||
|
||||
async _fetch(lastSynced, token) {
|
||||
let response = await fetch(`${HOST}/sync?lst=${lastSynced}`, {
|
||||
headers: { ...HEADERS, Authorization: `Bearer ${token}` },
|
||||
let response = await fetch(`${Constants.HOST}/sync?lst=${lastSynced}`, {
|
||||
headers: { ...Constants.HEADERS, Authorization: `Bearer ${token}` },
|
||||
});
|
||||
return await response.json();
|
||||
}
|
||||
@@ -108,9 +108,9 @@ export default class Sync {
|
||||
}
|
||||
|
||||
async _send(data, token) {
|
||||
let response = await fetch(`${HOST}/sync`, {
|
||||
let response = await fetch(`${Constants.HOST}/sync`, {
|
||||
method: "POST",
|
||||
headers: { ...HEADERS, Authorization: `Bearer ${token}` },
|
||||
headers: { ...Constants.HEADERS, Authorization: `Bearer ${token}` },
|
||||
body: JSON.stringify(data),
|
||||
});
|
||||
if (response.ok) {
|
||||
|
||||
Reference in New Issue
Block a user