This repository has been archived on 2023-03-18. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
osr-discourse-src/app/assets/javascripts/discourse/models/session.js.es6
T
2019-11-08 14:55:36 -05:00

25 lines
688 B
JavaScript

import RestModel from "discourse/models/rest";
import Singleton from "discourse/mixins/singleton";
import deprecated from "discourse-common/lib/deprecated";
// A data model representing current session data. You can put transient
// data here you might want later. It is not stored or serialized anywhere.
const Session = RestModel.extend({
init: function() {
this.set("highestSeenByTopic", {});
}
});
Session.reopenClass(Singleton);
Object.defineProperty(Discourse, "Session", {
get() {
deprecated("Import the Session object instead of using Discourse.Session", {
since: "2.4.0",
dropFrom: "2.5.0"
});
return Session;
}
});
export default Session;