You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
you have to declare a variable called "sessions" before you can used session config
Example:
let sessions = {};
menu.sessionConfig({
start: (sessionId, callback) => {
// initialize current session if it doesn't exist
// this is called by menu.run()
if (!(sessionId in sessions)) sessions[sessionId] = {};
callback();
},
end: (sessionId, callback) => {
// clear current session
// this is called by menu.end()
delete sessions[sessionId];
callback();
},
set: (sessionId, key, value, callback) => {
// store key-value pair in current session
sessions[sessionId][key] = value;
callback();
},
get: (sessionId, key, callback) => {
// retrieve value by key in current session
let value = sessions[sessionId][key];
callback(null, value);
}
});
When i use provided code to config session callbacks
i get this error:
UnhandledPromiseRejectionWarning: ReferenceError: sessions is not defined
@habbes how can i resolve this?
The text was updated successfully, but these errors were encountered: