Skip to content

Commit

Permalink
Do not show "updating" alert if data is cached and not filtered out
Browse files Browse the repository at this point in the history
If we have cached data, and the filters being applied have not
filtered all cached data out, do not show the "updating" alert
when refreshing the cache in the background.
  • Loading branch information
lukewaite committed Oct 25, 2017
1 parent c2b16b0 commit 1a79746
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).

## [Unreleased]
* Do not show "updating" alert if data is cached and not filtered out

## [v1.2.1] (2017-10-23)
* Default to the gitlab.com public API
Expand Down
10 changes: 5 additions & 5 deletions src/gitlab.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,17 +77,17 @@ def main(wf):
cmd = ['/usr/bin/python', wf.workflowfile('update.py')]
run_in_background('update', cmd)

# If script was passed a query, use it to filter projects
if query and projects:
projects = wf.filter(query, projects, key=search_for_project, min_score=20)

# Notify the user if the cache is being updated
if is_running('update'):
if is_running('update') and not projects:
wf.rerun = 1
wf.add_item('Updating project list via GitLab...',
valid=False,
icon=ICON_INFO)

# If script was passed a query, use it to filter projects
if query and projects:
projects = wf.filter(query, projects, key=search_for_project, min_score=20)

if not projects: # we have no data to show, so show a warning and stop
wf.add_item('No projects found', icon=ICON_WARNING)
wf.send_feedback()
Expand Down

0 comments on commit 1a79746

Please sign in to comment.