import { call, put } from 'redux-saga/effects';
import { Nixplay } from '~/lib/sdk';
import * as types from '~/store/actionTypes';
import { resolveCallback } from './helper';


export function* getWiFiSSID(action) {
	try {
		const ssid = yield call(Nixplay.network.getWiFiSSID);
		yield put({ type: types.GET_WIFISSID_SUCCESS, payload: { ssid } });
		yield call(resolveCallback, action);
	} catch (error) {
		yield put({ type: types.GET_WIFISSID_ERROR, payload: { error } });
	}
}
