Skip to content
This repository has been archived by the owner on Apr 21, 2021. It is now read-only.

Commit

Permalink
fix projects not opening
Browse files Browse the repository at this point in the history
  • Loading branch information
Tomasz Borychowski committed Apr 27, 2017
1 parent 7740a49 commit 2622226
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 11 deletions.
7 changes: 6 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
# Github Browser
Browse github orderly.


![Screenshot](screens/0-screenshot.png)



## Features
- Gives you **only 1 page** (no tabs, no clutter. just focus). If you really, really must see a link in another window you can use "Preview" feature (cmd+click or right-click on a link/image) or open it in your designated browser (chrome by default)
- Minimalist & extremely functional design
Expand All @@ -16,11 +16,14 @@ Browse github orderly.
- **TouchBar** Support




## Download
Check the [Releases](https://github.com/tborychowski/github-browser/releases) for the latest version.




## More Screenshots

#### Notifications
Expand Down Expand Up @@ -57,6 +60,8 @@ Check the [Releases](https://github.com/tborychowski/github-browser/releases) fo
![Settings](screens/5-settings.png)




## Dev install
```sh
git clone https://github.com/tborychowski/github-browser.git
Expand Down
20 changes: 11 additions & 9 deletions app/frame/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,17 @@ const gotoActions = {
};


function gotoUrl (where) {
$.trigger(EVENT.search.stop);
const isEvent = (where instanceof Event);
urlLoading = (isEvent ? where.url : where);
if (typeof urlLoading !== 'string' || !urlLoading || !webview.length) return;
if (urlLoading in gotoActions) gotoActions[urlLoading]();
else if (!isEvent && webview[0].loadURL) webview[0].loadURL(urlLoading);
}



function initialURL (initial) {
if (initial && args) {
const url = $.parseUrl(args.pop());
Expand Down Expand Up @@ -75,15 +86,6 @@ function purge () {



function gotoUrl (where) {
$.trigger(EVENT.search.stop);
const isEvent = (where instanceof Event);
urlLoading = (isEvent ? where.url : where);
if (typeof urlLoading !== 'string' || !urlLoading || !webview.length) return;
if (urlLoading in gotoActions) gotoActions[urlLoading]();
else if (!isEvent && webview[0].loadURL) webview[0].loadURL(urlLoading);
}

function onNavigationStart () {
$.trigger(EVENT.search.stop);
config.set('state.url', webview[0].getURL());
Expand Down
5 changes: 4 additions & 1 deletion app/projects/index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
const $ = require('../util');
const { EVENT, users, github } = require('../services');
const { EVENT, users, github, config } = require('../services');

let isReady = false, el, listEl;
const projectSort = (a, b) => a.name.localeCompare(b.name);
Expand Down Expand Up @@ -30,6 +30,9 @@ function remapProjectFields (project) {
project.created_at_str = $.prettyDate(project.created_at);
project.updated_at_str = $.prettyDate(project.updated_at);

const repo = project.owner_url.split('/').splice(-2).join('/');
project.html_url = `${config.get('baseUrl')}${repo}/projects/${project.number}`;

return users.getById(project.login).then(usr => {
if (usr) project.creator.name = usr.name;
return project;
Expand Down

0 comments on commit 2622226

Please sign in to comment.