Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ver] 6.3.0 #35

Merged
merged 7 commits into from
Feb 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 2 additions & 4 deletions __tests__/wire/processNotification.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,7 @@ it("sends notification to notification center if model is undefined", () => {
expect(notificationCenter).toHaveBeenCalledWith({
type: "UnknownModel created",
payload: {
id: 1,
loco: { idempotency_key: "aea41272f11ea5c75db8ba589156771f" },
id: 1
},
});
});
Expand All @@ -82,8 +81,7 @@ it("sends notification to notification center if model is defined", () => {
expect(notificationCenter).toHaveBeenCalledWith({
type: "Article created",
payload: {
id: 1,
loco: { idempotency_key: "aea41272f11ea5c75db8ba589156771g" },
id: 1
},
});
});
2 changes: 1 addition & 1 deletion dist/loco.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/loco.js.map

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "loco-js",
"version": "6.2.0",
"version": "6.3.0",
"description": "MVC framework for building web apps with ease.",
"main": "dist/loco.js",
"scripts": {
Expand Down
2 changes: 1 addition & 1 deletion src/loco.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ class Loco
init: (opts) ->
notificationsParams = opts.notifications ? {}
notificationsParams.protocolWithHost = opts.protocolWithHost
if notificationsParams?.enable isnt false
if notificationsParams.enable isnt false
wireOpts = { cookiesByCORS: opts.cookiesByCORS, authorizationHeader: opts.authorizationHeader }
this.wire = new Wire(notificationsParams, opts.notificationCenter, wireOpts)
this.wire.fetchSyncTime({ after: 'connect' })
Expand Down
1 change: 0 additions & 1 deletion src/wire.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ class Wire
window.clearInterval(this.pollingInterval);

check: ->
return if Object.keys(IdentityMap.imap).length is 0 and not this.token? and this.syncTime?
request = openRequest('GET', this._getURL() + '?' + ObjectUtils.toURIParams(this._requestParams()), this.reqOpts)
request.onload = (e) =>
if e.target.status >= 200 and e.target.status < 400
Expand Down
1 change: 1 addition & 0 deletions src/wire/processNotification.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ export default (notification, opts = {}) => {
if (opts.log) console.log(notification);
const [className, id, name, payload] = notification;
if (receivedAlready(payload.loco.idempotency_key)) return false;
delete payload.loco;
const model = getModelForRemoteName(className);
if (model === undefined) {
sendToNotificationCenter(
Expand Down
Loading