Skip to content
This repository has been archived by the owner on Sep 8, 2020. It is now read-only.

Commit

Permalink
vertical cards fixes (#734)
Browse files Browse the repository at this point in the history
Vertical cards fixes
  • Loading branch information
chrmod authored and spacifici committed Mar 20, 2019
1 parent 706a5fc commit 1b3e284
Show file tree
Hide file tree
Showing 4 changed files with 59 additions and 44 deletions.
12 changes: 11 additions & 1 deletion cliqz/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,23 @@ class Cliqz {
constructor(app, actions) {
this.app = app;
this.app.modules['ui'] = {
status() {},
status() {
return {
name: 'ui',
isEnabled: true,
loadingTime: 0,
loadingTimeSync: 0,
windows: [],
state: {},
};
},
name: 'ui',
action(action, ...args) {
return Promise.resolve().then(() => {
return actions[action](...args);
});
},
isEnabled: true,
};
this.mobileCards = app.modules['mobile-cards'].background.actions;
this.geolocation = app.modules['geolocation'].background.actions;
Expand Down
74 changes: 34 additions & 40 deletions cliqz/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions cliqz/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@
"name": "cliqz-native",
"version": "0.0.0",
"scripts": {
"start": "node node_modules/react-native/local-cli/cli.js start",
"start": "node node_modules/react-native/local-cli/cli.js start --reset-cache",
"build": "node node_modules/react-native/local-cli/cli.js bundle --platform android --entry-file index.js --bundle-output ../mozilla-release/mobile/android/app/src/main/assets/index.android.bundle --dev=false --reset-cache",
"build.dev": "node node_modules/react-native/local-cli/cli.js bundle --platform android --entry-file index.js --bundle-output ../mozilla-release/mobile/android/app/src/main/assets/index.android.bundle --dev=true --reset-cache"
},
"devDependencies": {
"jsc-android": "^236355.1.1"
},
"dependencies": {
"browser-core": "https://s3.amazonaws.com/cdncliqz/update/edge/rn-ghostery-android/v1.35/1.35.0.444bb07.tgz",
"browser-core": "https://s3.amazonaws.com/cdncliqz/update/edge/rn-ghostery-android/v1.35/1.35.0.38e6545.tgz",
"cliqz-logo-database": "^0.1.2",
"moment": "^2.24.0",
"react": "^16.6.3",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
import com.facebook.react.bridge.ReactMethod;
import com.facebook.react.bridge.ReadableArray;
import com.facebook.react.bridge.ReadableMap;
import com.facebook.react.bridge.ReadableType;
import com.facebook.react.bridge.WritableMap;

import org.mozilla.gecko.EventDispatcher;
Expand Down Expand Up @@ -144,7 +145,17 @@ public void sendExternalMessage(String extensionId, ReadableMap message) {
final ReadableArray args = message.getArray("args");

if (SystemAddon.MODULE_CORE.equals(module) && SystemAddon.ACTION_SEND_TELEMETRY.equals(action)) {
final GeckoBundle signal = Utils.convertReadableMapToGeckoBundle(args.getMap(0));
GeckoBundle signal = null;
final ReadableType type = args.getType(0);
switch (type) {
case Map:
signal = Utils.convertReadableMapToGeckoBundle(args.getMap(0));
break;
default:
Log.d(getClass().getSimpleName(), "Unexpected telemetry shape");
return;
}

final String schema = args.getString(2);

if (schema != null) {
Expand Down

0 comments on commit 1b3e284

Please sign in to comment.