Skip to content
This repository has been archived by the owner on Feb 10, 2023. It is now read-only.

Commit

Permalink
fix(init-error): Solve first run error
Browse files Browse the repository at this point in the history
fixes #21
  • Loading branch information
hypery2k committed Apr 5, 2017
1 parent 67eaa72 commit ceeae2e
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 4 deletions.
1 change: 1 addition & 0 deletions test/e2e/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
"noEmitOnError": true
},
"exclude": [
"../../node_modules",
"node_modules",
"platforms",
"**/*.aot.ts"
Expand Down
25 changes: 22 additions & 3 deletions test/spec/urlhandler.android.spec.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,29 @@
import './mocks/general.mock';
import {
handleOpenURL
handleOpenURL,
handleIntent
} from '../../urlhandler.android';

describe('Android', function() {
it('handleOpenURL', function() {

describe('handleOpenURL', function() {

it('function should be defined', function() {
expect(handleOpenURL).toBeDefined();
});
});

});

describe('handleIntent', function() {

it('function should be defined', function() {
expect(handleOpenURL).toBeDefined();
});

it('should handle empty data', function() {
handleIntent({getData:()=> ''});
});

});

});
2 changes: 1 addition & 1 deletion urlhandler.android.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ let lastReceivedData = null;

export function handleIntent(intent: any) {
let data = intent.getData();
if (data.toString() !== lastReceivedData.toString()) {
if (lastReceivedData === null || data.toString() !== lastReceivedData.toString()) {
try {
if (new String(intent.getAction()).valueOf() === new String(android.content.Intent.ACTION_VIEW).valueOf()) {
application.android.on(application.AndroidApplication.activityResultEvent, (eventData) => {
Expand Down

0 comments on commit ceeae2e

Please sign in to comment.