Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit24993c9

Browse files
committed
fix(settings): missing values when moving to react
1 parent2de92f8 commit24993c9

File tree

5 files changed

+23
-72
lines changed

5 files changed

+23
-72
lines changed

‎src/client/containers/Settings/General/index.jsx‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ class GeneralSettings extends React.Component {
109109
title='Site Url'
110110
subtitle={
111111
<div>
112-
Publicly accessible URL of this site.<i>ex:{this.props.viewdata.hosturl}</i>
112+
Publicly accessible URL of this site.<i>ex:{this.props.viewdata.get('hosturl')}</i>
113113
</div>
114114
}
115115
component={SiteUrl}
@@ -186,7 +186,7 @@ GeneralSettings.propTypes = {
186186
}
187187

188188
constmapStateToProps=state=>({
189-
viewdata:state.common,
189+
viewdata:state.common.viewdata,
190190
settings:state.settings.settings
191191
})
192192

‎src/client/containers/Settings/Tickets/index.jsx‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -242,7 +242,7 @@ class TicketsSettings extends React.Component {
242242
subtitle={
243243
<div>
244244
Allow the creation of tickets by users that are unregistered. (
245-
<ahref={viewdata.hosturl+'/newissue'}>{viewdata.hosturl+'/newissue'}</a>)
245+
<ahref={viewdata.get('hosturl')+'/newissue'}>{viewdata.get('hosturl')+'/newissue'}</a>)
246246
</div>
247247
}
248248
component={
@@ -514,7 +514,7 @@ TicketsSettings.propTypes = {
514514
}
515515

516516
constmapStateToProps=state=>({
517-
viewdata:state.common,
517+
viewdata:state.common.viewdata,
518518
settings:state.settings.settings,
519519
tagsSettings:state.tagsSettings
520520
})

‎src/client/containers/Topbar/conversationsDropdown.jsx‎

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ class ConversationsDropdownPartial extends React.Component {
4444
}
4545

4646
onUpdateConversationsNotifications(data){
47+
helpers.setupScrollers()
4748
if(!helpers.arrayIsEqual(this.conversations,data.conversations))this.conversations=data.conversations
4849
}
4950

@@ -72,8 +73,20 @@ class ConversationsDropdownPartial extends React.Component {
7273
Start Conversation
7374
</a>
7475
}
76+
footerComponent={
77+
<divclassName={'uk-text-center'+(this.conversations.length<1 ?' hide' :'')}>
78+
<a
79+
className={'no-ajaxy hoverUnderline'}
80+
onClick={()=>{
81+
History.pushState(null,null,'/messages')
82+
}}
83+
>
84+
View All Conversations
85+
</a>
86+
</div>
87+
}
7588
>
76-
<divclassName={'items close-on-click'}>
89+
<divclassName={'itemsscrollableclose-on-click'}>
7790
<ul>
7891
{this.conversations.map(conversation=>{
7992
constprofilePic=conversation.partner.image||'defaultProfile.jpg'

‎src/models/user.js‎

Lines changed: 0 additions & 64 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,6 @@ const COLLECTION = 'accounts'
4545
*@property {String} tOTPKey One Time Password Secret Key
4646
*@property {Number} tOTPPeriod One Time Password Key Length (Time) - Default 30 Seconds
4747
*@property {String} accessToken API Access Token
48-
*@property {Array} iOSDeviceTokens Array of String based device Ids for Apple iOS devices. *push notifications*
4948
*@property {Object} preferences Object to hold user preferences
5049
*@property {Boolean} preferences.autoRefreshTicketGrid Enable the auto refresh of the ticket grid.
5150
*@property {Boolean} deleted Account Deleted
@@ -190,38 +189,6 @@ userSchema.methods.removeL2Auth = function (callback) {
190189
})
191190
}
192191

193-
userSchema.methods.addDeviceToken=function(token,type,callback){
194-
if(_.isUndefined(token))returncallback('Invalid token')
195-
varuser=this
196-
// type 1 = iOS
197-
// type 2 = Android
198-
if(type===1){
199-
if(hasDeviceToken(user,token,type))returncallback(null,token)
200-
201-
user.iOSDeviceTokens.push(token)
202-
user.save(function(err){
203-
if(err)returncallback(err,null)
204-
205-
callback(null,token)
206-
})
207-
}
208-
}
209-
210-
userSchema.methods.removeDeviceToken=function(token,type,callback){
211-
varuser=this
212-
if(type===1){
213-
if(!hasDeviceToken(user,token,type))returncallback()
214-
215-
winston.debug('Removing Device: '+token)
216-
user.iOSDeviceTokens.splice(_.indexOf(this.iOSDeviceTokens,token),1)
217-
user.save(function(err,u){
218-
if(err)returncallback(err,null)
219-
220-
returncallback(null,u.iOSDeviceTokens)
221-
})
222-
}
223-
}
224-
225192
userSchema.methods.addOpenChatWindow=function(convoId,callback){
226193
if(convoId===undefined){
227194
if(!_.isFunction(callback))returnfalse
@@ -731,35 +698,4 @@ userSchema.statics.getAdmins = function (obj, callback) {
731698
})
732699
}
733700

734-
/**
735-
* Checks if a user has device token already
736-
*
737-
*@memberof User
738-
*@instance
739-
*@method hasDeviceToken
740-
*
741-
*@param {User} user User to check against
742-
*@param {String} token token to check for in given user
743-
*@param {Number} type Type of Device token to check.
744-
*@return {Boolean}
745-
*@example
746-
* type:
747-
* 1: iOS
748-
* 2: Android
749-
* 3: Windows
750-
*/
751-
functionhasDeviceToken(user,token,type){
752-
if(type===1){
753-
varmatches=_.filter(user.iOSDeviceTokens,function(value){
754-
if(value===token){
755-
returnvalue
756-
}
757-
})
758-
759-
returnmatches.length>0
760-
}
761-
762-
returnfalse
763-
}
764-
765701
module.exports=mongoose.model(COLLECTION,userSchema)

‎src/socketio/chatSocket.js‎

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -192,15 +192,16 @@ async function updateConversationsNotifications (socket) {
192192
constMessage=require('../models/chat/message')
193193
constConversation=require('../models/chat/conversation')
194194

195-
Conversation.getConversationsWithLimit(user._id,10,(err,conversation)=>{
195+
Conversation.getConversationsWithLimit(user._id,null,(err,conversations)=>{
196196
if(err){
197197
winston.warn(err.message)
198198
returnfalse
199199
}
200200

201201
constconvos=[]
202+
202203
async.eachSeries(
203-
conversation,
204+
conversations,
204205
(convo,done)=>{
205206
constc=convo.toObject()
206207

@@ -239,8 +240,9 @@ async function updateConversationsNotifications (socket) {
239240
},
240241
err=>{
241242
if(err)returnfalse
243+
242244
returnutils.sendToSelf(socket,socketEventConst.MESSAGES_UPDATE_UI_CONVERSATION_NOTIFICATIONS,{
243-
conversations:convos
245+
conversations:convos.length>=10 ?convos.slice(0,9) :convos
244246
})
245247
}
246248
)

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp