@github/alive-client
Advanced tools
Comparing version 0.0.1 to 0.0.2
@@ -93,10 +93,12 @@ import { AlivePresence, getPresenceKey, isPresenceChannel } from './presence.js'; | ||
online() { | ||
var _a; | ||
this.lastCameOnline = Date.now(); | ||
this.state = 'online'; | ||
this.retrying?.abort(); | ||
(_a = this.retrying) === null || _a === void 0 ? void 0 : _a.abort(); | ||
this.socket.open(); | ||
} | ||
offline() { | ||
var _a; | ||
this.state = 'offline'; | ||
this.retrying?.abort(); | ||
(_a = this.retrying) === null || _a === void 0 ? void 0 : _a.abort(); | ||
this.socket.close(); | ||
@@ -182,2 +184,3 @@ } | ||
notifyPresenceChannel(channel, presenceItems) { | ||
var _a, _b; | ||
const userPresenceById = new Map(); | ||
@@ -204,3 +207,3 @@ for (const presenceItem of presenceItems) { | ||
const otherUsers = Array.from(userPresenceById.values()).filter(user => user.userId !== userId); | ||
const ownUserRemoteMetadata = userPresenceById.get(this.userId)?.metadata ?? []; | ||
const ownUserRemoteMetadata = (_b = (_a = userPresenceById.get(this.userId)) === null || _a === void 0 ? void 0 : _a.metadata) !== null && _b !== void 0 ? _b : []; | ||
const ownUserLocalMetadata = this.presenceMetadata.getChannelMetadata(channel, { | ||
@@ -207,0 +210,0 @@ subscriber, |
export const IDLE_METADATA_KEY = '_i'; | ||
function markMetadataAsLocal(metadata) { | ||
return { | ||
...metadata, | ||
isLocal: true | ||
}; | ||
return Object.assign(Object.assign({}, metadata), { isLocal: true }); | ||
} | ||
@@ -82,4 +79,4 @@ class PresenceMetadataForChannel { | ||
const channelMetadata = this.metadataByChannel.get(channelName); | ||
return channelMetadata?.getMetadata(localizationOptions) || []; | ||
return (channelMetadata === null || channelMetadata === void 0 ? void 0 : channelMetadata.getMetadata(localizationOptions)) || []; | ||
} | ||
} |
{ | ||
"name": "@github/alive-client", | ||
"version": "0.0.1", | ||
"version": "0.0.2", | ||
"description": "Template repository making it easier for developers to write frontend functionality that will be integrated into dotcom", | ||
@@ -20,7 +20,8 @@ "main": "dist/index.js", | ||
"size-limit": "npm run build && size-limit", | ||
"prepublishOnly": "npm run build && size-limit" | ||
"prepublishOnly": "npm run build && size-limit", | ||
"postpublish": "npm publish --ignore-scripts --@github:registry='https://npm.pkg.github.com'" | ||
}, | ||
"repository": { | ||
"type": "git", | ||
"url": "git+https://github.com/github/frontend-project.git" | ||
"url": "git+https://github.com/github/alive-client.git" | ||
}, | ||
@@ -30,7 +31,7 @@ "keywords": [], | ||
"prettier": "@github/prettier-config", | ||
"license": "ISC", | ||
"license": "MIT", | ||
"bugs": { | ||
"url": "https://github.com/github/frontend-project/issues" | ||
"url": "https://github.com/github/alive-client/issues" | ||
}, | ||
"homepage": "https://github.com/github/frontend-project#readme", | ||
"homepage": "https://github.com/github/alive-client#readme", | ||
"size-limit": [ | ||
@@ -37,0 +38,0 @@ { |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No bug tracker
MaintenancePackage does not have a linked bug tracker in package.json.
Found 1 instance in 1 package
No website
QualityPackage does not have a website.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Mixed license
License(Experimental) Package contains multiple licenses.
Found 1 instance in 1 package
No bug tracker
MaintenancePackage does not have a linked bug tracker in package.json.
Found 1 instance in 1 package
No website
QualityPackage does not have a website.
Found 1 instance in 1 package
28437
0