-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
18 changed files
with
391 additions
and
140 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
root = true | ||
|
||
[*.{js,css}] | ||
[*.{js,css,ts,tsx}] | ||
indent_style = space | ||
indent_size = 2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
module.exports = { | ||
export default { | ||
// Public URL of your installation | ||
url: 'https://diff.sapzil.org/', | ||
|
||
|
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
import * as firebase from 'firebase'; | ||
import { Observable } from 'rxjs/Observable'; | ||
|
||
function getFirebaseUid(): string | null { | ||
const user = firebase.auth().currentUser; | ||
return user && user.uid; | ||
} | ||
|
||
function refValues<T>(ref: firebase.database.Reference): Observable<T> { | ||
return Observable.create((obs: any) => { | ||
const callback = (snapshot: firebase.database.DataSnapshot | null, err: string | null | undefined) => { | ||
if (err) { | ||
obs.error(err); | ||
return; | ||
} | ||
obs.next(snapshot!.val()); | ||
}; | ||
ref.on('value', callback); | ||
return () => ref.off('value', callback); | ||
}); | ||
} | ||
|
||
function reviewStatesRef(pullRequestId: number): firebase.database.Reference { | ||
return firebase.database().ref(`reviewStates/${pullRequestId}/${getFirebaseUid()}`); | ||
} | ||
|
||
export function observeReviewStates(pullRequestId: number): Observable<{[fileId: string]: boolean}> { | ||
return refValues(reviewStatesRef(pullRequestId)); | ||
} | ||
|
||
export function setReviewState(pullRequestId: number, fileId: string, reviewState: boolean): Promise<any> { | ||
return reviewStatesRef(pullRequestId).child(fileId).set(reviewState); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
/// <reference types="react-scripts" /> | ||
|
||
declare module 'http-link-header' { | ||
declare function parse(link: string); | ||
} | ||
|
||
declare module 'marked' { | ||
export default function(markdown: string, options: any); | ||
} |
Oops, something went wrong.