Socket
Socket
Sign inDemoInstall

@meetelise/chat

Package Overview
Dependencies
Maintainers
2
Versions
355
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@meetelise/chat - npm Package Compare versions

Comparing version 1.0.0-rc.17 to 1.0.0-rc.18

4

dist/src/chatID.d.ts

@@ -6,6 +6,6 @@ /**

*/
export declare function getChatID(): string;
export declare function getChatID(buildingId: number): string;
/**
* Create a new chat ID and discard any old one.
*/
export declare function createChatID(): string;
export declare function createChatID(buildingId: number): string;
import { v4 as uuid } from "uuid";
const key = "com.meetelise.chatID";
const keyPrefix = "com.meetelise.chatID";
function generateFullKey(buildingId) {
return `${keyPrefix}-${buildingId}`;
}
/**

@@ -8,3 +11,4 @@ * Get or create a UUID that is the same between browser sessions.

*/
export function getChatID() {
export function getChatID(buildingId) {
const key = generateFullKey(buildingId);
const existingID = localStorage.getItem(key);

@@ -14,3 +18,3 @@ if (existingID)

else
return createChatID();
return createChatID(buildingId);
}

@@ -20,4 +24,5 @@ /**

*/
export function createChatID() {
export function createChatID(buildingId) {
const id = uuid();
const key = generateFullKey(buildingId);
localStorage.setItem(key, id);

@@ -24,0 +29,0 @@ return id;

@@ -24,10 +24,10 @@ import Talk from "talkjs";

export function createTalkJSPopup(building, theme) {
const popup = session.createPopup(createConversation(building, theme, getChatID()));
const popup = session.createPopup(createConversation(building, theme, getChatID(building.id)));
return popup;
}
export function restartConversation(popup, building, theme) {
popup.select(createConversation(building, theme, createChatID()));
popup.select(createConversation(building, theme, createChatID(building.id)));
}
export function updateTheme(popup, building, theme) {
popup.select(createConversation(building, theme, getChatID()));
popup.select(createConversation(building, theme, getChatID(building.id)));
}

@@ -34,0 +34,0 @@ function createConversation(building, theme, chatID) {

{
"name": "@meetelise/chat",
"version": "1.0.0-rc.17",
"version": "1.0.0-rc.18",
"description": "",

@@ -5,0 +5,0 @@ "type": "module",

import { v4 as uuid } from "uuid";
const key = "com.meetelise.chatID";
const keyPrefix = "com.meetelise.chatID";
function generateFullKey(buildingId: number): string {
return `${keyPrefix}-${buildingId}`;
}
/**

@@ -10,6 +14,7 @@ * Get or create a UUID that is the same between browser sessions.

*/
export function getChatID(): string {
export function getChatID(buildingId: number): string {
const key = generateFullKey(buildingId);
const existingID = localStorage.getItem(key);
if (existingID) return existingID;
else return createChatID();
else return createChatID(buildingId);
}

@@ -20,6 +25,7 @@

*/
export function createChatID(): string {
export function createChatID(buildingId: number): string {
const id = uuid();
const key = generateFullKey(buildingId);
localStorage.setItem(key, id);
return id;
}

@@ -33,3 +33,3 @@ import Talk from "talkjs";

const popup = session.createPopup(
createConversation(building, theme, getChatID())
createConversation(building, theme, getChatID(building.id))
);

@@ -44,3 +44,3 @@ return popup;

): void {
popup.select(createConversation(building, theme, createChatID()));
popup.select(createConversation(building, theme, createChatID(building.id)));
}

@@ -53,3 +53,3 @@

): void {
popup.select(createConversation(building, theme, getChatID()));
popup.select(createConversation(building, theme, getChatID(building.id)));
}

@@ -56,0 +56,0 @@

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc