Skip to content

Commit 1ac1350

Browse files
authored
Merge branch 'main' into bugfix/video-audio-map
2 parents 0b9046c + 70d7f4a commit 1ac1350

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+941
-648
lines changed

.eslintrc.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -177,5 +177,16 @@ module.exports = {
177177
},
178178
files: ["packages/components/navigation/**"],
179179
},
180+
{
181+
rules: {
182+
"no-restricted-imports": [
183+
"error",
184+
{
185+
patterns: [disallowScriptsImports],
186+
},
187+
],
188+
},
189+
files: ["packages/dapp-root/**", "apps/**"],
190+
},
180191
],
181192
};

Root.tsx

Lines changed: 0 additions & 247 deletions
This file was deleted.

apps/gno-dapp/App.tsx

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
import { AppConfig } from "@/context/AppConfigProvider";
2+
import AppRoot from "@/dapp-root/App";
3+
4+
const config: AppConfig = {
5+
disableBuyTokensButton: true,
6+
disableDAppStore: true,
7+
forceNetworkList: ["gno-test5", "gno-portal"],
8+
forceDAppsList: ["feed", "organizations"],
9+
defaultNetworkId: "gno-test5",
10+
homeScreen: "Feed",
11+
};
12+
13+
export const App: React.FC = () => {
14+
return <AppRoot config={config} />;
15+
};

apps/gno-dapp/index.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
import { registerRootComponent } from "expo";
2+
3+
import { App } from "./App";
4+
5+
// registerRootComponent calls AppRegistry.registerComponent('main', () => App);
6+
// It also ensures that whether you load the app in Expo Go or in a native build,
7+
// the environment is set up appropriately
8+
registerRootComponent(App);

apps/gno-dapp/netlify.toml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
[build]
2+
command = 'sed -i "s/teritori-dapp/gno-dapp/" package.json && npm i -g sharp-cli && npx expo-optimize && npx expo export -p web'
3+
publish = '/dist'
4+
[build.environment]
5+
NODE_OPTIONS = "--max_old_space_size=4096"
6+
[[redirects]]
7+
from = "/*"
8+
to = "/index.html"
9+
status = 200

apps/teritori-dapp/App.tsx

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
import { AppConfig } from "@/context/AppConfigProvider";
2+
import AppRoot from "@/dapp-root/App";
3+
4+
const config: AppConfig = {
5+
defaultNetworkId: "teritori",
6+
homeScreen: "Home",
7+
};
8+
9+
export const App: React.FC = () => {
10+
return <AppRoot config={config} />;
11+
};

apps/teritori-dapp/index.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
import { registerRootComponent } from "expo";
2+
3+
import { App } from "./App";
4+
5+
// registerRootComponent calls AppRegistry.registerComponent('main', () => App);
6+
// It also ensures that whether you load the app in Expo Go or in a native build,
7+
// the environment is set up appropriately
8+
registerRootComponent(App);
File renamed without changes.

gno/Makefile

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
KEY = teritori-test4-seed
1+
KEY = teritori
22
BASE = teritori
3-
REMOTE = https://rpc.gno.land:443
4-
CHAIN_ID = portal-loop
3+
REMOTE = https://rpc.test5.gno.land
4+
CHAIN_ID = test5
55

66
.PHONY: add_social_feeds_realm add_utf16_pkg add_ujson_pkg add_flags_index_pkg add_dao_interfaces_pkg add_social_feed all
77

@@ -21,7 +21,7 @@ add_social_feed:
2121
-pkgpath "gno.land/r/${BASE}/social_feeds" \
2222
-func="CreateFeed" \
2323
-gas-fee="1000000ugnot" \
24-
-gas-wanted="3000000" \
24+
-gas-wanted="5000000" \
2525
-remote="${REMOTE}" \
2626
-chainid="${CHAIN_ID}" \
2727
-broadcast \

go/internal/indexerhandler/feed.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,10 @@ func (h *Handler) handleExecuteReactPost(_ *Message, execMsg *wasmtypes.MsgExecu
103103
}
104104

105105
userReactions := make(map[string]interface{})
106-
post.UserReactions.Scan(&userReactions)
106+
if err := json.Unmarshal(post.UserReactions, &userReactions); err != nil {
107+
h.logger.Error("failed to unmarshal UserReactions", zap.String("data", string(post.UserReactions)), zap.Error(err))
108+
}
109+
107110
var users []networks.UserID
108111
reactedUsers, found := userReactions[reactPost.Icon]
109112
if found {

go/pkg/feed/service.go

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -171,8 +171,13 @@ func (s *FeedService) Posts(ctx context.Context, req *feedpb.PostsRequest) (*fee
171171
posts := make([]*feedpb.Post, len(dbPostWithExtras))
172172
for idx, dbPost := range dbPostWithExtras {
173173
var reactions []*feedpb.Reaction
174-
reactionsMap := map[string]interface{}{}
175-
dbPost.UserReactions.Scan(&reactionsMap)
174+
175+
reactionsMap := make(map[string]interface{})
176+
if err := json.Unmarshal(dbPost.UserReactions, &reactionsMap); err != nil {
177+
s.conf.Logger.Error("failed to unmarshal UserReactions", zap.String("data", string(dbPost.UserReactions)), zap.Error(err))
178+
continue
179+
}
180+
176181
for icon, users := range reactionsMap {
177182
ownState := false
178183
if queryUserID != "" {

0 commit comments

Comments
 (0)