Skip to content

Commit

Permalink
Merge branch 'main' into bugfix/video-audio-map
Browse files Browse the repository at this point in the history
  • Loading branch information
WaDadidou authored Nov 28, 2024
2 parents 0b9046c + 70d7f4a commit 1ac1350
Show file tree
Hide file tree
Showing 43 changed files with 941 additions and 648 deletions.
11 changes: 11 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -177,5 +177,16 @@ module.exports = {
},
files: ["packages/components/navigation/**"],
},
{
rules: {
"no-restricted-imports": [
"error",
{
patterns: [disallowScriptsImports],
},
],
},
files: ["packages/dapp-root/**", "apps/**"],
},
],
};
247 changes: 0 additions & 247 deletions Root.tsx

This file was deleted.

15 changes: 15 additions & 0 deletions apps/gno-dapp/App.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import { AppConfig } from "@/context/AppConfigProvider";
import AppRoot from "@/dapp-root/App";

const config: AppConfig = {
disableBuyTokensButton: true,
disableDAppStore: true,
forceNetworkList: ["gno-test5", "gno-portal"],
forceDAppsList: ["feed", "organizations"],
defaultNetworkId: "gno-test5",
homeScreen: "Feed",
};

export const App: React.FC = () => {
return <AppRoot config={config} />;
};
8 changes: 8 additions & 0 deletions apps/gno-dapp/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import { registerRootComponent } from "expo";

import { App } from "./App";

// registerRootComponent calls AppRegistry.registerComponent('main', () => App);
// It also ensures that whether you load the app in Expo Go or in a native build,
// the environment is set up appropriately
registerRootComponent(App);
9 changes: 9 additions & 0 deletions apps/gno-dapp/netlify.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
[build]
command = 'sed -i "s/teritori-dapp/gno-dapp/" package.json && npm i -g sharp-cli && npx expo-optimize && npx expo export -p web'
publish = '/dist'
[build.environment]
NODE_OPTIONS = "--max_old_space_size=4096"
[[redirects]]
from = "/*"
to = "/index.html"
status = 200
11 changes: 11 additions & 0 deletions apps/teritori-dapp/App.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import { AppConfig } from "@/context/AppConfigProvider";
import AppRoot from "@/dapp-root/App";

const config: AppConfig = {
defaultNetworkId: "teritori",
homeScreen: "Home",
};

export const App: React.FC = () => {
return <AppRoot config={config} />;
};
8 changes: 8 additions & 0 deletions apps/teritori-dapp/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import { registerRootComponent } from "expo";

import { App } from "./App";

// registerRootComponent calls AppRegistry.registerComponent('main', () => App);
// It also ensures that whether you load the app in Expo Go or in a native build,
// the environment is set up appropriately
registerRootComponent(App);
File renamed without changes.
8 changes: 4 additions & 4 deletions gno/Makefile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
KEY = teritori-test4-seed
KEY = teritori
BASE = teritori
REMOTE = https://rpc.gno.land:443
CHAIN_ID = portal-loop
REMOTE = https://rpc.test5.gno.land
CHAIN_ID = test5

.PHONY: add_social_feeds_realm add_utf16_pkg add_ujson_pkg add_flags_index_pkg add_dao_interfaces_pkg add_social_feed all

Expand All @@ -21,7 +21,7 @@ add_social_feed:
-pkgpath "gno.land/r/${BASE}/social_feeds" \
-func="CreateFeed" \
-gas-fee="1000000ugnot" \
-gas-wanted="3000000" \
-gas-wanted="5000000" \
-remote="${REMOTE}" \
-chainid="${CHAIN_ID}" \
-broadcast \
Expand Down
5 changes: 4 additions & 1 deletion go/internal/indexerhandler/feed.go
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,10 @@ func (h *Handler) handleExecuteReactPost(_ *Message, execMsg *wasmtypes.MsgExecu
}

userReactions := make(map[string]interface{})
post.UserReactions.Scan(&userReactions)
if err := json.Unmarshal(post.UserReactions, &userReactions); err != nil {
h.logger.Error("failed to unmarshal UserReactions", zap.String("data", string(post.UserReactions)), zap.Error(err))
}

var users []networks.UserID
reactedUsers, found := userReactions[reactPost.Icon]
if found {
Expand Down
9 changes: 7 additions & 2 deletions go/pkg/feed/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -171,8 +171,13 @@ func (s *FeedService) Posts(ctx context.Context, req *feedpb.PostsRequest) (*fee
posts := make([]*feedpb.Post, len(dbPostWithExtras))
for idx, dbPost := range dbPostWithExtras {
var reactions []*feedpb.Reaction
reactionsMap := map[string]interface{}{}
dbPost.UserReactions.Scan(&reactionsMap)

reactionsMap := make(map[string]interface{})
if err := json.Unmarshal(dbPost.UserReactions, &reactionsMap); err != nil {
s.conf.Logger.Error("failed to unmarshal UserReactions", zap.String("data", string(dbPost.UserReactions)), zap.Error(err))
continue
}

for icon, users := range reactionsMap {
ownState := false
if queryUserID != "" {
Expand Down
Loading

0 comments on commit 1ac1350

Please sign in to comment.