Comments (9)
Would adding big-integer
as a peerDependency and adding that bigint logic to our output be a good idea or a bad one?
from fx-fotos.
indeed. I have an error while starting UI in the browser:
I suspect that the reason might be in the platform: I am using windows.
@Roman-Uholnikov Hey there, yes maybe it's because of your OS which is windows. I have setted up the project as ehsan said and it's working properly on my machine which I'm using arch linux
from fx-fotos.
@ehsan6sha Hey, thank you I have configured my IDE and replaced project files as you said now I can work on the issues.
from fx-fotos.
For anyone who has the same issue in Dfinity, this is the whole process that worked for me:
(open file temp/instructions.txt)
photos/temp at main ยท functionland/photos (github.com)
To explain here is the changes I made:
1- Added BigInt defenition to the below files by adding this line to the top of each file:
if (typeof BigInt === 'undefined') global.BigInt = require('big-integer')
- ...\node_modules@dfinity\agent\lib\cjs\agent\http\transforms.js
- ...\node_modules@dfinity\authentication\lib\cjs\index.js
2- Added Buffer definition to the below files by adding this line to the top of each file:
global.Buffer = global.Buffer || require('buffer').Buffer;
- ...\node_modules@dfinity\principal\lib\cjs\index.js
3- Added a localStorage definition to the below file by adding this line to the top of each file: (however it seems we can simmply pass it as a parameter in authClient.create)
if (!global.localStorage) {
global.localStorage = {
_data : {},
setItem : function(id, val) { return this._data[id] = String(val); },
getItem : function(id) { return this._data.hasOwnProperty(id) ? this._data[id] : undefined; },
removeItem : function(id) { return delete this._data[id]; },
clear : function() { return this._data = {}; }
};
}
- ...\node_modules@dfinity\auth-client\lib\cjs\index.js
4- Added window defintion by modifying the below files by adding the below parts of codes:
- Modified AuthClientCreateOptions defenition to:
export interface AuthClientCreateOptions {
/**
* An identity to use as the base
*/
identity?: SignIdentity;
/**
* Optional storage with get, set, and remove. Uses LocalStorage by default
*/
storage?: AuthClientStorage;
/**
* Optional window object with open, addEventListener, removeEventListener, history.pushState, location.href. Uses window by default
*/
windowObj?: any;
}
in file '...\node_modules@dfinity\auth-client\lib\cjs\index.d.ts'
- Modified create function defenition to:
static async create(options = {}) {
var _a;
const storage = (_a = options.storage) !== null && _a !== void 0 ? _a : new LocalStorage('ic-');
const windowObj = (_a = options.windowObj) !== null && _a !== void 0 ? _a : window;
let key = null;
if (options.identity) {
key = options.identity;
}
else {
const maybeIdentityStorage = await storage.get(KEY_LOCALSTORAGE_KEY);
if (maybeIdentityStorage) {
try {
key = identity_1.Ed25519KeyIdentity.fromJSON(maybeIdentityStorage);
}
catch (e) {
// Ignore this, this means that the localStorage value isn't a valid Ed25519KeyIdentity
// serialization.
}
}
}
let identity = new agent_1.AnonymousIdentity();
let chain = null;
if (key) {
try {
const chainStorage = await storage.get(KEY_LOCALSTORAGE_DELEGATION);
if (chainStorage) {
chain = identity_1.DelegationChain.fromJSON(chainStorage);
// Verify that the delegation isn't expired.
if (!authentication_1.isDelegationValid(chain)) {
await _deleteStorage(storage);
key = null;
}
else {
identity = identity_1.DelegationIdentity.fromDelegation(key, chain);
}
}
}
catch (e) {
console.error(e);
// If there was a problem loading the chain, delete the key.
await _deleteStorage(storage);
key = null;
}
}
return new this(identity, key, chain, storage, windowObj);
}
in file '...\node_modules@dfinity\auth-client\lib\cjs\index.js'
5- Added the following imports to my file where I wanted to use Dfinity libraries
import 'text-encoding';
import 'react-native-get-random-values'
6- Installed 'react-native-polyfill-globals' to include 'readAsArrayBuffer' for react-native.
7- Changed one occurance of BigInt equality check from normal '===' in @dfinity\candid\lib\cjs\utils\leb128.js to the below:
if (BigInt(0).equals(value)) {
from fx-fotos.
Would adding
big-integer
as a peerDependency and adding that bigint logic to our output be a good idea or a bad one?
Do you mean instead of adding it to dfinity files directly, leave them unchanged and instead adding it to the main file? I actually tried that approach and was still getting the same error until I added it directly to the top of dfinity files. I hope i wasn't doing it the wrong way but I tried multiple times
from fx-fotos.
@Roman-Uholnikov Keyvan said you have an issue after installation, did you try this?
from fx-fotos.
indeed. I have an error while starting UI in the browser:
I suspect that the reason might be in the platform: I am using windows.
from fx-fotos.
indeed. I have an error while starting UI in the browser:
I suspect that the reason might be in the platform: I am using windows.@Roman-Uholnikov Hey there, yes maybe it's because of your OS which is windows. I have setted up the project as ehsan said and it's working properly on my machine which I'm using arch linux
I just tested on Windows too and is working fine so should not be OS. That's the beauty of expo lol
I am not sure why "browser" is here though. Maybe that is the keyword to issue
from fx-fotos.
This is patched and will be applied automatically. Fixed in
#63
from fx-fotos.
Related Issues (20)
- Fotos: change expo library to camera roll
- Fotos: Make video play in single image mode like Google Photos HOT 1
- Fotos: get metadata of photos and store in localdb in the background
- Fotos: implement first version of search page
- Fotos: Navigate to next story on story highlight screen
- picture in picture
- Fotos: Improve gallery change view pinch gesture
- Fotos: Delete does not work HOT 1
- Ketley Prates
- Adding blox manually does not change the icon
- Implementation of successful upload check
- Delete does not really delete the asset
- Uploaded assets cannot be restored on a totally new app(device)
- Thumb scroll position is not synced with finger position HOT 1
- Highlights does not show anything other than Recently when photos are only from 2023 HOT 1
- Photo gallery
- Fx-Fotos crashes with the latest RN-fula
- fatal error: 'fbjni/fbjni.h' file not found
- Switch recyclerlistview to shopify/flash-list
- every 5 seconds submit a replication request for current cids
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. ๐๐๐
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google โค๏ธ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from fx-fotos.