This commit is contained in:
pypy
2020-01-12 00:44:58 +09:00
parent 424c42a8d1
commit f38eee3dd5
+34 -30
View File
@@ -1572,8 +1572,8 @@ if (window.CefSharp) {
API.$on('NOTIFICATION:ACCEPT', function (args) { API.$on('NOTIFICATION:ACCEPT', function (args) {
var ctx = this.cachedNotifications.get(args.param.notificationId); var ctx = this.cachedNotifications.get(args.param.notificationId);
if (ctx && if (ctx &&
!ctx.$isExpired) { !ctx.$isDeleted) {
ctx.$isExpired = true; ctx.$isDeleted = true;
args.ref = ctx; args.ref = ctx;
this.$emit('NOTIFICATION:@DELETE', { this.$emit('NOTIFICATION:@DELETE', {
param: { param: {
@@ -1592,8 +1592,8 @@ if (window.CefSharp) {
API.$on('NOTIFICATION:HIDE', function (args) { API.$on('NOTIFICATION:HIDE', function (args) {
var ctx = this.cachedNotifications.get(args.param.notificationId); var ctx = this.cachedNotifications.get(args.param.notificationId);
if (ctx && if (ctx &&
!ctx.$isExpired) { !ctx.$isDeleted) {
ctx.$isExpired = true; ctx.$isDeleted = true;
args.ref = ctx; args.ref = ctx;
this.$emit('NOTIFICATION:@DELETE', { this.$emit('NOTIFICATION:@DELETE', {
param: { param: {
@@ -1606,7 +1606,7 @@ if (window.CefSharp) {
API.markAllNotificationsAsExpired = function () { API.markAllNotificationsAsExpired = function () {
for (var ctx of this.cachedNotifications.values()) { for (var ctx of this.cachedNotifications.values()) {
if (!ctx.$isExpired) { if (!ctx.$isDeleted) {
ctx.$isExpired = true; ctx.$isExpired = true;
} }
} }
@@ -1615,8 +1615,8 @@ if (window.CefSharp) {
API.checkExpiredNotifcations = function () { API.checkExpiredNotifcations = function () {
for (var ctx of this.cachedNotifications.values()) { for (var ctx of this.cachedNotifications.values()) {
if (ctx.$isExpired && if (ctx.$isExpired &&
!ctx.$isExpired) { !ctx.$isDeleted) {
ctx.$isExpired = true; ctx.$isDeleted = true;
this.$emit('NOTIFICATION:@DELETE', { this.$emit('NOTIFICATION:@DELETE', {
param: { param: {
notificationId: ctx.id notificationId: ctx.id
@@ -1664,6 +1664,7 @@ if (window.CefSharp) {
seen: false, seen: false,
created_at: '', created_at: '',
// custom // custom
$isDeleted: false,
$isExpired: false, $isExpired: false,
// //
...ref ...ref
@@ -1785,7 +1786,7 @@ if (window.CefSharp) {
for (var ctx of this.cachedNotifications.values()) { for (var ctx of this.cachedNotifications.values()) {
if (ctx.type === 'friendRequest' && if (ctx.type === 'friendRequest' &&
ctx.senderUserId === userId && ctx.senderUserId === userId &&
!ctx.$isExpired) { !ctx.$isDeleted) {
return ctx.id; return ctx.id;
} }
} }
@@ -1832,7 +1833,7 @@ if (window.CefSharp) {
API.markAllPlayerModerationsAsExpired = function () { API.markAllPlayerModerationsAsExpired = function () {
for (var ctx of this.cachedPlayerModerations.values()) { for (var ctx of this.cachedPlayerModerations.values()) {
if (!ctx.$isExpired) { if (!ctx.$isDeleted) {
ctx.$isExpired = true; ctx.$isExpired = true;
} }
} }
@@ -1841,8 +1842,8 @@ if (window.CefSharp) {
API.checkExpiredPlayerModerations = function () { API.checkExpiredPlayerModerations = function () {
for (var ctx of this.cachedPlayerModerations.values()) { for (var ctx of this.cachedPlayerModerations.values()) {
if (ctx.$isExpired && if (ctx.$isExpired &&
!ctx.$isExpired) { !ctx.$isDeleted) {
ctx.$isExpired = true; ctx.$isDeleted = true;
this.$emit('PLAYER-MODERATION:@DELETE', { this.$emit('PLAYER-MODERATION:@DELETE', {
param: { param: {
playerModerationId: ctx.id playerModerationId: ctx.id
@@ -1874,8 +1875,8 @@ if (window.CefSharp) {
if (ctx.type === type && if (ctx.type === type &&
ctx.targetUserId === moderated && ctx.targetUserId === moderated &&
ctx.sourceUserId === cuid && ctx.sourceUserId === cuid &&
!ctx.$isExpired) { !ctx.$isDeleted) {
ctx.$isExpired = true; ctx.$isDeleted = true;
this.$emit('PLAYER-MODERATION:@DELETE', { this.$emit('PLAYER-MODERATION:@DELETE', {
param: { param: {
playerModerationId: ctx.id playerModerationId: ctx.id
@@ -1900,6 +1901,7 @@ if (window.CefSharp) {
targetDisplayName: '', targetDisplayName: '',
created: '', created: '',
// custom // custom
$isDeleted: false,
$isExpired: false, $isExpired: false,
// //
...ref ...ref
@@ -2092,7 +2094,7 @@ if (window.CefSharp) {
API.$on('FAVORITE:GROUP', function (args) { API.$on('FAVORITE:GROUP', function (args) {
var ref = this.updateFavoriteGroup(args.json); var ref = this.updateFavoriteGroup(args.json);
args.ref = ref; args.ref = ref;
if (!ref.$isExpired) { if (!ref.$isDeleted) {
if (ref.type === 'friend') { if (ref.type === 'friend') {
this.favoriteFriendGroups.find((ctx) => { this.favoriteFriendGroups.find((ctx) => {
if (ctx.name === ref.name) { if (ctx.name === ref.name) {
@@ -2189,7 +2191,7 @@ if (window.CefSharp) {
API.markAllFavoritesAsExpired = function () { API.markAllFavoritesAsExpired = function () {
for (var key in this.favorite) { for (var key in this.favorite) {
var ctx = this.favorite[key]; var ctx = this.favorite[key];
if (!ctx.$isExpired) { if (!ctx.$isDeleted) {
ctx.$isExpired = true; ctx.$isExpired = true;
} }
} }
@@ -2199,8 +2201,8 @@ if (window.CefSharp) {
for (var key in this.favorite) { for (var key in this.favorite) {
var ctx = this.favorite[key]; var ctx = this.favorite[key];
if (ctx.$isExpired && if (ctx.$isExpired &&
!ctx.$isExpired) { !ctx.$isDeleted) {
ctx.$isExpired = true; ctx.$isDeleted = true;
this.$emit('FAVORITE:@DELETE', { this.$emit('FAVORITE:@DELETE', {
param: { param: {
favoriteId: ctx.id favoriteId: ctx.id
@@ -2241,7 +2243,7 @@ if (window.CefSharp) {
for (var key in this.favorite) { for (var key in this.favorite) {
var ctx = this.favorite[key]; var ctx = this.favorite[key];
if (ctx.type === 'friend' && if (ctx.type === 'friend' &&
!ctx.$isExpired) { !ctx.$isDeleted) {
++N; ++N;
} }
} }
@@ -2262,7 +2264,7 @@ if (window.CefSharp) {
for (var key in this.favorite) { for (var key in this.favorite) {
var ctx = this.favorite[key]; var ctx = this.favorite[key];
if (ctx.type === 'world' && if (ctx.type === 'world' &&
!ctx.$isExpired) { !ctx.$isDeleted) {
++N; ++N;
} }
} }
@@ -2283,7 +2285,7 @@ if (window.CefSharp) {
for (var key in this.favorite) { for (var key in this.favorite) {
var ctx = this.favorite[key]; var ctx = this.favorite[key];
if (ctx.type === 'avatar' && if (ctx.type === 'avatar' &&
!ctx.$isExpired) { !ctx.$isDeleted) {
++N; ++N;
} }
} }
@@ -2302,7 +2304,7 @@ if (window.CefSharp) {
API.markAllFavoriteGroupsAsExpired = function () { API.markAllFavoriteGroupsAsExpired = function () {
for (var key in this.favoriteGroup) { for (var key in this.favoriteGroup) {
var ctx = this.favoriteGroup[key]; var ctx = this.favoriteGroup[key];
if (!ctx.$isExpired) { if (!ctx.$isDeleted) {
ctx.$isExpired = true; ctx.$isExpired = true;
} }
} }
@@ -2312,8 +2314,8 @@ if (window.CefSharp) {
for (var key in this.favoriteGroup) { for (var key in this.favoriteGroup) {
var ctx = this.favoriteGroup[key]; var ctx = this.favoriteGroup[key];
if (ctx.$isExpired && if (ctx.$isExpired &&
!ctx.$isExpired) { !ctx.$isDeleted) {
ctx.$isExpired = true; ctx.$isDeleted = true;
this.$emit('FAVORITE:GROUP:@DELETE', { this.$emit('FAVORITE:GROUP:@DELETE', {
param: { param: {
favoriteGroupId: ctx.id favoriteGroupId: ctx.id
@@ -2392,7 +2394,7 @@ if (window.CefSharp) {
}; };
for (var key in this.favoriteGroup) { for (var key in this.favoriteGroup) {
var ctx = this.favoriteGroup[key]; var ctx = this.favoriteGroup[key];
if (!ctx.$isExpired) { if (!ctx.$isDeleted) {
if (ctx.type === 'friend') { if (ctx.type === 'friend') {
set1(this.favoriteFriendGroups, ctx); set1(this.favoriteFriendGroups, ctx);
} else if (ctx.type === 'world') { } else if (ctx.type === 'world') {
@@ -2404,7 +2406,7 @@ if (window.CefSharp) {
} }
for (var key in this.favoriteGroup) { for (var key in this.favoriteGroup) {
var ctx = this.favoriteGroup[key]; var ctx = this.favoriteGroup[key];
if (!ctx.$isExpired) { if (!ctx.$isDeleted) {
if (ctx.type === 'friend') { if (ctx.type === 'friend') {
set2(this.favoriteFriendGroups, ctx); set2(this.favoriteFriendGroups, ctx);
} else if (ctx.type === 'world') { } else if (ctx.type === 'world') {
@@ -2416,7 +2418,7 @@ if (window.CefSharp) {
} }
for (var key in this.favorite) { for (var key in this.favorite) {
var ctx = this.favorite[key]; var ctx = this.favorite[key];
if (!ctx.$isExpired) { if (!ctx.$isDeleted) {
if (ctx.type === 'friend') { if (ctx.type === 'friend') {
// eslint-disable-next-line no-loop-func // eslint-disable-next-line no-loop-func
this.favoriteFriendGroups.find((ref) => { this.favoriteFriendGroups.find((ref) => {
@@ -2476,8 +2478,8 @@ if (window.CefSharp) {
for (var key in this.favorite) { for (var key in this.favorite) {
var ctx = this.favorite[key]; var ctx = this.favorite[key];
if (ctx.favoriteId === objectId && if (ctx.favoriteId === objectId &&
!ctx.$isExpired) { !ctx.$isDeleted) {
ctx.$isExpired = true; ctx.$isDeleted = true;
API.$emit('FAVORITE:@DELETE', { API.$emit('FAVORITE:@DELETE', {
param: { param: {
favoriteId: ctx.id favoriteId: ctx.id
@@ -2499,6 +2501,7 @@ if (window.CefSharp) {
favoriteId: '', favoriteId: '',
tags: [], tags: [],
// custom // custom
$isDeleted: false,
$isExpired: false, $isExpired: false,
$group: '', $group: '',
// //
@@ -2589,6 +2592,7 @@ if (window.CefSharp) {
visibility: '', visibility: '',
tags: [], tags: [],
// custom // custom
$isDeleted: false,
$isExpired: false, $isExpired: false,
// //
...ref ...ref
@@ -2666,8 +2670,8 @@ if (window.CefSharp) {
for (var key in this.favorite) { for (var key in this.favorite) {
var ctx = this.favorite[key]; var ctx = this.favorite[key];
if (ctx.$group === name && if (ctx.$group === name &&
!ctx.$isExpired) { !ctx.$isDeleted) {
ctx.$isExpired = true; ctx.$isDeleted = true;
API.$emit('FAVORITE:@DELETE', { API.$emit('FAVORITE:@DELETE', {
param: { param: {
favoriteId: ctx.id favoriteId: ctx.id