How to use the react-native-config.RN_TEXTILE_CAMERA_ROLL_THREAD_KEY function in react-native-config

To help you get started, we’ve selected a few react-native-config examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github textileio / photos / App / Sagas / NodeLifecycle.ts View on Github external
yield call(newTextile, REPO_PATH, LOG_LEVELS)
    yield put(TextileNodeActions.createNodeSuccess())
    yield put(TextileNodeActions.startingNode())
    yield call(start)
    const sessions: ReadonlyArray = yield call(cafeSessions)
    if (sessions.length < 1) {
      const cafeOverride: string = Config.RN_TEXTILE_CAFE_OVERRIDE
      if (cafeOverride) {
        yield call(registerOverrideCafe, cafeOverride)
      } else {
        yield call(discoverAndRegisterCafes)
      }
    }
    const threadsResult: ReadonlyArray = yield call(threads)
    const cameraRollThreadName = 'Camera Roll'
    const cameraRollThreadKey = Config.RN_TEXTILE_CAMERA_ROLL_THREAD_KEY
    const cameraRollThread = threadsResult.find((thread) => thread.key === cameraRollThreadKey)
    if (!cameraRollThread) {
      yield call(addThread, cameraRollThreadKey, cameraRollThreadName, false)
    }
    yield put(TextileNodeActions.startNodeSuccess())
  } catch (error) {
    try {
      if (error.message === MIGRATION_NEEDED_ERROR) {
        // instruct the node to export data to files
        yield call(migrateRepo, REPO_PATH)
        // store the fact there is a pending migration in the preferences redux persisted state
        yield put(MigrationActions.migrationNeeded())
        yield call(announcePeer)
        // call the create/start sequence again
        yield call(createAndStartNode, dispatch)
      } else if (error.message === INIT_NEEDED_ERROR) {
github textileio / photos / App / features / group / add-photo / sagas.ts View on Github external
    thread => thread.key === Config.RN_TEXTILE_CAMERA_ROLL_THREAD_KEY
  )
github textileio / photos / App / features / photos / sagas.ts View on Github external
    thread => thread.key === Config.RN_TEXTILE_CAMERA_ROLL_THREAD_KEY
  )
github textileio / photos / App / Sagas / PhotoViewingSagas.ts View on Github external
export function* refreshThreads(
  action: ActionType
) {
  try {
    const threadsResult: IThreadList = yield call(Textile.threads.list)
    for (const thread of threadsResult.items) {
      /**
       * Filters to only threads we want to work with
       */
      const useIt =
        thread.key.indexOf('textile_photos-shared') === 0 ||
        thread.key === Config.RN_TEXTILE_CAMERA_ROLL_THREAD_KEY
      if (useIt) {
        const valid = thread.headBlocks.length > 0
        const withValid = { ...thread, valid }
        yield put(GroupsActions.insertThread(withValid))
        yield put(GroupsActions.refreshThreadRequest(thread.id))
      }
    }
  } catch (error) {
    yield put(
      TextileEventsActions.newErrorMessage('refreshThreads', error.message)
    )
    yield put(GroupsActions.refreshThreadsError(error))
  }
}
github textileio / photos / App / Redux / PhotoViewingSelectors.ts View on Github external
.filter((thread) => {
      return thread.key !== Config.RN_TEXTILE_CAMERA_ROLL_THREAD_KEY &&
             BLACKLIST.indexOf(thread.name) < 0
    })