Removed use of session store to prevent store overflow.

This commit is contained in:
Martin Edenhofer 2015-11-26 00:55:56 +01:00
parent d71090df6e
commit 0de7b74ae6
2 changed files with 4 additions and 29 deletions

View file

@ -443,25 +443,11 @@ class App.Controller extends Spine.Controller
} }
processData: true, processData: true,
success: (data, status, xhr) -> success: (data, status, xhr) ->
App.SessionStorage.set( "user-ticket-popover::#{params.user_id}", data )
# load assets
App.Collection.loadAssets( data.assets ) App.Collection.loadAssets( data.assets )
show( params, { open: data.ticket_ids_open, closed: data.ticket_ids_closed } ) show( params, { open: data.ticket_ids_open, closed: data.ticket_ids_closed } )
) )
# get data # get data
data = App.SessionStorage.get( "user-ticket-popover::#{params.user_id}" )
if data
show( params, { open: data.ticket_ids_open, closed: data.ticket_ids_closed } )
@delay(
->
fetch(params)
1000
'fetch'
)
else
fetch(params) fetch(params)
userTicketPopupsDestroy: => userTicketPopupsDestroy: =>

View file

@ -13,27 +13,17 @@ class App.WidgetTag extends App.Controller
constructor: -> constructor: ->
super super
@cacheKey = "tags::#{@object_type}::#{@object.id}" @key = "tags::#{@object_type}::#{@object.id}"
if @tags if @tags
@render() @render()
return return
@tags = App.SessionStorage.get( @cacheKey ) || []
if !_.isEmpty(@tags)
@render()
@delay(
=>
@fetch()
1000
'fetch'
)
else
@fetch() @fetch()
fetch: => fetch: =>
@ajax( @ajax(
id: @cacheKey id: @key
type: 'GET' type: 'GET'
url: @apiPath + '/tags' url: @apiPath + '/tags'
data: data:
@ -42,7 +32,6 @@ class App.WidgetTag extends App.Controller
processData: true processData: true
success: (data, status, xhr) => success: (data, status, xhr) =>
@tags = data.tags @tags = data.tags
App.SessionStorage.set( @cacheKey, @tags )
@render() @render()
) )