mirror of
https://github.com/zero-peak/ZeroOmega.git
synced 2025-02-02 11:08:13 -05:00
Ignore empty data in profile update.
This commit is contained in:
parent
ec5a35682c
commit
674f501ada
@ -41,7 +41,10 @@ class ChromeTabs
|
|||||||
@_badgeTab = null
|
@_badgeTab = null
|
||||||
if not tab.url? or tab.url.indexOf("chrome") == 0
|
if not tab.url? or tab.url.indexOf("chrome") == 0
|
||||||
if @_defaultAction
|
if @_defaultAction
|
||||||
chrome.browserAction.setTitle(title: @_defaultAction.title, tabId: tab.id)
|
chrome.browserAction.setTitle({
|
||||||
|
title: @_defaultAction.title
|
||||||
|
tabId: tab.id
|
||||||
|
})
|
||||||
@clearIcon tab.id
|
@clearIcon tab.id
|
||||||
return
|
return
|
||||||
@actionForUrl(tab.url).then (action) =>
|
@actionForUrl(tab.url).then (action) =>
|
||||||
|
@ -619,6 +619,10 @@ class Options
|
|||||||
url = OmegaPac.Profiles.updateUrl(profile)
|
url = OmegaPac.Profiles.updateUrl(profile)
|
||||||
if url
|
if url
|
||||||
results[key] = @fetchUrl(url, opt_bypass_cache).then((data) =>
|
results[key] = @fetchUrl(url, opt_bypass_cache).then((data) =>
|
||||||
|
# Errors and unsuccessful response codes shoud have been already
|
||||||
|
# rejected by fetchUrl and will not end up here.
|
||||||
|
# So empty data indicates success without any update (e.g. 304).
|
||||||
|
return profile unless data
|
||||||
profile = OmegaPac.Profiles.byKey(key, @_options)
|
profile = OmegaPac.Profiles.byKey(key, @_options)
|
||||||
profile.lastUpdate = new Date().toISOString()
|
profile.lastUpdate = new Date().toISOString()
|
||||||
if OmegaPac.Profiles.update(profile, data)
|
if OmegaPac.Profiles.update(profile, data)
|
||||||
|
Loading…
Reference in New Issue
Block a user