renamed Followings into Caching and fixed #85 (adding more files to the commit)
This commit is contained in:
parent
34e3990af6
commit
dacd2ee019
5 changed files with 25 additions and 67 deletions
|
@ -72,9 +72,9 @@ function(HostApp, Core, Paths, URI) {
|
|||
var url = URI(Paths.mkApiRootPath("/posts/" + id));
|
||||
Paths.getURL(url.toString(), "GET", callback, null);
|
||||
|
||||
} else if(this.followings.followings[entity]) {
|
||||
} else if(this.cache.followings[entity]) {
|
||||
|
||||
getRemoteStatus(this.followings.followings[entity].profile);
|
||||
getRemoteStatus(this.cache.followings[entity].profile);
|
||||
|
||||
} else {
|
||||
|
||||
|
|
|
@ -33,8 +33,8 @@ function(HostApp, Timeline) {
|
|||
var status = statuses[i];
|
||||
|
||||
var name;
|
||||
if(this.followings.followings[status.entity]) {
|
||||
name = this.followings.followings[status.entity].profile["https://tent.io/types/info/basic/v0.1.0"].name;
|
||||
if(this.cache.followings[status.entity]) {
|
||||
name = this.cache.followings[status.entity].profile["https://tent.io/types/info/basic/v0.1.0"].name;
|
||||
}
|
||||
|
||||
HostApp.notificateUserAboutMention(status.content.text, name || status.entity, status.id, status.entity);
|
||||
|
|
|
@ -26,7 +26,7 @@ function(HostApp, Core, Paths, URI) {
|
|||
this.profile_template.entity.innerHTML = this.entity;
|
||||
this.profile_template.entity.href = this.entity;
|
||||
|
||||
this.setFollowingButton(!!this.followings.followings[this.entity]);
|
||||
this.setFollowingButton(!!this.cache.followings[this.entity]);
|
||||
|
||||
this.getProfile();
|
||||
}
|
||||
|
@ -313,14 +313,14 @@ function(HostApp, Core, Paths, URI) {
|
|||
Profile.prototype.toggleFollow = function() {
|
||||
|
||||
var _this = this;
|
||||
var callback = function(resp) { _this.followings.getAllFollowings(); debug(resp.responseText) };
|
||||
var callback = function(resp) { _this.cache.getAllFollowings(); debug(resp.responseText) };
|
||||
|
||||
if (this.followings.followings[this.entity]) {
|
||||
if (this.cache.followings[this.entity]) {
|
||||
|
||||
var url = URI(Paths.mkApiRootPath("/followings/" + this.followings.followings[this.entity].id));
|
||||
var url = URI(Paths.mkApiRootPath("/followings/" + this.cache.followings[this.entity].id));
|
||||
Paths.getURL(url.toString(), "DELETE", callback);
|
||||
this.setFollowingButton(false);
|
||||
delete this.followings.followings[this.entity];
|
||||
delete this.cache.followings[this.entity];
|
||||
|
||||
} else {
|
||||
|
||||
|
|
Reference in a new issue